{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"3数据预处理和特征工程.ipynb","version":"0.3.2","provenance":[],"collapsed_sections":["xpWz2TtUdvRJ","8KQFksq5dcSb","Z_sxr-MSdAdU"],"toc_visible":true},"kernelspec":{"name":"python3","display_name":"Python 3"},"accelerator":"TPU"},"cells":[{"metadata":{"id":"XDQLvalphp5h","colab_type":"text"},"cell_type":"markdown","source":["# sklearn当中特征矩阵必须是二维"]},{"metadata":{"id":"yhtc44nmBDQr","colab_type":"text"},"cell_type":"markdown","source":["# 数据预处理"]},{"metadata":{"id":"LQKq_AosBJ67","colab_type":"text"},"cell_type":"markdown","source":["## 1数据无量纲化"]},{"metadata":{"id":"nY0QvAfwBTcA","colab_type":"text"},"cell_type":"markdown","source":["### preprocessing.MinMaxScaler"]},{"metadata":{"id":"nOV9zkSWBVEX","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":34},"outputId":"8944edd0-791d-4f73-e575-b4b6394210d8","executionInfo":{"status":"ok","timestamp":1551316957789,"user_tz":-480,"elapsed":934,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["from sklearn.preprocessing import MinMaxScaler\n","data = [[-1, 2], [-0.5, 6], [0, 10], [1, 18]]\n","#不太熟悉numpy的小伙伴，能够判断data的结构吗？\n","#如果换成表是什么样子？\n","data"],"execution_count":1,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[[-1, 2], [-0.5, 6], [0, 10], [1, 18]]"]},"metadata":{"tags":[]},"execution_count":1}]},{"metadata":{"id":"AUl3-kp5BeW1","colab_type":"code","outputId":"f81dcf24-8df4-4c2c-e453-4080b33bb477","executionInfo":{"status":"ok","timestamp":1546004089335,"user_tz":-480,"elapsed":833,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":213}},"cell_type":"code","source":["import pandas as pd\n","pd.DataFrame(data)"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>0</th>\n","      <th>1</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>-1.0</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>-0.5</td>\n","      <td>6</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>0.0</td>\n","      <td>10</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>1.0</td>\n","      <td>18</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["     0   1\n","0 -1.0   2\n","1 -0.5   6\n","2  0.0  10\n","3  1.0  18"]},"metadata":{"tags":[]},"execution_count":2}]},{"metadata":{"id":"tEfAIxcXBjnF","colab_type":"code","outputId":"74da55a3-f4c4-4d8f-9b15-0a876bbb2ee9","executionInfo":{"status":"ok","timestamp":1551316975788,"user_tz":-480,"elapsed":712,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":85}},"cell_type":"code","source":["#实现归一化\n","scaler = MinMaxScaler() #实例化\n","scaler = scaler.fit(data) #fit，在这里本质是生成min(x)和max(x)\n","result = scaler.transform(data) #通过接口导出结果\n","result"],"execution_count":2,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[0.  , 0.  ],\n","       [0.25, 0.25],\n","       [0.5 , 0.5 ],\n","       [1.  , 1.  ]])"]},"metadata":{"tags":[]},"execution_count":2}]},{"metadata":{"id":"SuxKrz_rBmgb","colab_type":"code","outputId":"29b3981d-7da5-479a-cc7e-482fe127fc39","executionInfo":{"status":"ok","timestamp":1551316980897,"user_tz":-480,"elapsed":660,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":85}},"cell_type":"code","source":["result_ = scaler.fit_transform(data) #训练和导出结果一步达成\n","scaler.inverse_transform(result) #将归一化后的结果逆转"],"execution_count":3,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[-1. ,  2. ],\n","       [-0.5,  6. ],\n","       [ 0. , 10. ],\n","       [ 1. , 18. ]])"]},"metadata":{"tags":[]},"execution_count":3}]},{"metadata":{"id":"MOC7fQIXBqgd","colab_type":"code","outputId":"f5aa63ec-de91-4427-f300-dc7216ee5a7a","executionInfo":{"status":"ok","timestamp":1551317034606,"user_tz":-480,"elapsed":626,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":85}},"cell_type":"code","source":["#使用MinMaxScaler的参数feature_range实现将数据归一化到[0,1]以外的范围中\n","data = [[-1, 2], [-0.5, 6], [0, 10], [1, 18]]\n","scaler = MinMaxScaler(feature_range=[5,10]) #依然实例化 将数据归一化到[5,10]\n","result = scaler.fit_transform(data) #fit_transform一步导出结果\n","result"],"execution_count":4,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[ 5.  ,  5.  ],\n","       [ 6.25,  6.25],\n","       [ 7.5 ,  7.5 ],\n","       [10.  , 10.  ]])"]},"metadata":{"tags":[]},"execution_count":4}]},{"metadata":{"id":"0FORUHoMBs1V","colab_type":"code","outputId":"ff48991c-eb61-42cc-b952-ca5b265ecb6f","executionInfo":{"status":"ok","timestamp":1546004143134,"user_tz":-480,"elapsed":736,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":36}},"cell_type":"code","source":["#当X中的特征数量非常多的时候，fit会报错并表示，数据量太大了我计算不了\n","#此时使用partial_fit作为训练接口\n","scaler = scaler.partial_fit(data)\n","scaler"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["MinMaxScaler(copy=True, feature_range=[5, 10])"]},"metadata":{"tags":[]},"execution_count":7}]},{"metadata":{"id":"l_98zqlMB6l9","colab_type":"text"},"cell_type":"markdown","source":["####  使用numpy来实现归一化"]},{"metadata":{"id":"MkRnvDpGtUfU","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":34},"outputId":"338c88ff-a8ff-4b4a-e782-9f25f516a727","executionInfo":{"status":"ok","timestamp":1551317222778,"user_tz":-480,"elapsed":810,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["import numpy as np\n","np.array(data).min(axis=0)"],"execution_count":7,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([-1.,  2.])"]},"metadata":{"tags":[]},"execution_count":7}]},{"metadata":{"id":"99Crwp6Ltp28","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":34},"outputId":"4cf3d889-97a4-41fb-bd92-15413548f669","executionInfo":{"status":"ok","timestamp":1551317252170,"user_tz":-480,"elapsed":691,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["np.array(data).max(axis=0)"],"execution_count":8,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([ 1., 18.])"]},"metadata":{"tags":[]},"execution_count":8}]},{"metadata":{"id":"3mY-c2CmCDop","colab_type":"code","outputId":"c3d57b8b-e3af-49f4-b713-f06872cc0c0c","executionInfo":{"status":"ok","timestamp":1551317263308,"user_tz":-480,"elapsed":696,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":85}},"cell_type":"code","source":["import numpy as np\n","X = np.array([[-1, 2], [-0.5, 6], [0, 10], [1, 18]])\n","#归一化\n","X_nor = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0))\n","# 对每一列数据求最小值\n","X_nor"],"execution_count":9,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[0.  , 0.  ],\n","       [0.25, 0.25],\n","       [0.5 , 0.5 ],\n","       [1.  , 1.  ]])"]},"metadata":{"tags":[]},"execution_count":9}]},{"metadata":{"colab_type":"code","id":"ccyreYJOCIxN","outputId":"47c4d9ed-40d3-4a0d-a29c-f2149fb93920","executionInfo":{"status":"ok","timestamp":1551317267599,"user_tz":-480,"elapsed":647,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":85}},"cell_type":"code","source":["\n","#逆转归一化\n","X_returned = X_nor * (X.max(axis=0) - X.min(axis=0)) + X.min(axis=0)\n","X_returned"],"execution_count":10,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[-1. ,  2. ],\n","       [-0.5,  6. ],\n","       [ 0. , 10. ],\n","       [ 1. , 18. ]])"]},"metadata":{"tags":[]},"execution_count":10}]},{"metadata":{"id":"zgosa_vRCO3J","colab_type":"text"},"cell_type":"markdown","source":["### preprocessing.StandardScaler"]},{"metadata":{"id":"3YFZYDHWCJv7","colab_type":"code","outputId":"a5153b37-f3cf-4815-9aa4-825e90b99ef4","executionInfo":{"status":"ok","timestamp":1551317288529,"user_tz":-480,"elapsed":642,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["from sklearn.preprocessing import StandardScaler\n","data = [[-1, 2], [-0.5, 6], [0, 10], [1, 18]]\n","stdscaler = StandardScaler() #实例化\n","stdscaler.fit(data) #fit，本质是生成均值和方差"],"execution_count":11,"outputs":[{"output_type":"execute_result","data":{"text/plain":["StandardScaler(copy=True, with_mean=True, with_std=True)"]},"metadata":{"tags":[]},"execution_count":11}]},{"metadata":{"id":"ZPwluc-CCSz5","colab_type":"code","outputId":"8d1bce70-10f3-4def-8d74-734d1160213c","executionInfo":{"status":"ok","timestamp":1551317311933,"user_tz":-480,"elapsed":679,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["stdscaler.mean_ #查看均值的属性mean_"],"execution_count":13,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([-0.125,  9.   ])"]},"metadata":{"tags":[]},"execution_count":13}]},{"metadata":{"id":"UCdeWgbeCVap","colab_type":"code","outputId":"d92acc65-2969-49ec-da82-4478ed331692","executionInfo":{"status":"ok","timestamp":1551317319890,"user_tz":-480,"elapsed":656,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["stdscaler.var_ #查看方差的属性var_"],"execution_count":14,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([ 0.546875, 35.      ])"]},"metadata":{"tags":[]},"execution_count":14}]},{"metadata":{"id":"C8RNHn5LuJNx","colab_type":"code","colab":{}},"cell_type":"code","source":["# stdscaler.std_ \n","# AttributeError: 'StandardScaler' object has no attribute 'std_'"],"execution_count":0,"outputs":[]},{"metadata":{"id":"Ek1EzfzrCZFB","colab_type":"code","outputId":"19c8e681-9242-461e-df55-f5078be623e5","executionInfo":{"status":"ok","timestamp":1551317442692,"user_tz":-480,"elapsed":671,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":85}},"cell_type":"code","source":["x_std = stdscaler.transform(data) #通过接口导出结果\n","x_std"],"execution_count":19,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[-1.18321596, -1.18321596],\n","       [-0.50709255, -0.50709255],\n","       [ 0.16903085,  0.16903085],\n","       [ 1.52127766,  1.52127766]])"]},"metadata":{"tags":[]},"execution_count":19}]},{"metadata":{"id":"bSvkiae6Ccm2","colab_type":"code","outputId":"d826da3a-781a-4db1-da2e-71fb96a1a9ef","executionInfo":{"status":"ok","timestamp":1551317445800,"user_tz":-480,"elapsed":695,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["x_std.mean() #导出的结果是一个数组，用mean()查看均值"],"execution_count":20,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0.0"]},"metadata":{"tags":[]},"execution_count":20}]},{"metadata":{"id":"SBYYRhASChEL","colab_type":"code","outputId":"739faa2f-ea98-48db-ef8e-cb851d8046a2","executionInfo":{"status":"ok","timestamp":1551317447633,"user_tz":-480,"elapsed":667,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["x_std.std() #用std()查看方差"],"execution_count":21,"outputs":[{"output_type":"execute_result","data":{"text/plain":["1.0"]},"metadata":{"tags":[]},"execution_count":21}]},{"metadata":{"id":"VvtJ8RJeChrv","colab_type":"code","outputId":"c11d12c8-e299-432f-86bd-871309727826","executionInfo":{"status":"ok","timestamp":1551317458746,"user_tz":-480,"elapsed":652,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":85}},"cell_type":"code","source":["stdscaler.fit_transform(data) #使用fit_transform(data)一步达成结果"],"execution_count":22,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[-1.18321596, -1.18321596],\n","       [-0.50709255, -0.50709255],\n","       [ 0.16903085,  0.16903085],\n","       [ 1.52127766,  1.52127766]])"]},"metadata":{"tags":[]},"execution_count":22}]},{"metadata":{"id":"JC5Z1ZFMCnqy","colab_type":"code","outputId":"97fcce39-edcb-4cfe-9492-e8d982d9ae75","executionInfo":{"status":"ok","timestamp":1551317466047,"user_tz":-480,"elapsed":648,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":85}},"cell_type":"code","source":["stdscaler.inverse_transform(x_std) #使用inverse_transform逆转标准化"],"execution_count":23,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[-1. ,  2. ],\n","       [-0.5,  6. ],\n","       [ 0. , 10. ],\n","       [ 1. , 18. ]])"]},"metadata":{"tags":[]},"execution_count":23}]},{"metadata":{"id":"0PObfkMAwLaP","colab_type":"text"},"cell_type":"markdown","source":["#### numpy实现std"]},{"metadata":{"id":"b9J_iB8JwjwW","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":85},"outputId":"e8fbec8e-fcc8-4a69-8a14-608e7d361c24","executionInfo":{"status":"ok","timestamp":1551318012293,"user_tz":-480,"elapsed":911,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["X"],"execution_count":26,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[-1. ,  2. ],\n","       [-0.5,  6. ],\n","       [ 0. , 10. ],\n","       [ 1. , 18. ]])"]},"metadata":{"tags":[]},"execution_count":26}]},{"metadata":{"id":"jh5h6X78wj57","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":34},"outputId":"9969f989-87e0-4158-d136-956210cefb2a","executionInfo":{"status":"ok","timestamp":1551318070807,"user_tz":-480,"elapsed":669,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["X_mean = X.mean(axis=0)\n","X_mean"],"execution_count":29,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([-0.125,  9.   ])"]},"metadata":{"tags":[]},"execution_count":29}]},{"metadata":{"id":"JRqDI5vQw0Jk","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":34},"outputId":"5b00814b-c8e6-4009-9ff2-5939ba1bdcf1","executionInfo":{"status":"ok","timestamp":1551318097193,"user_tz":-480,"elapsed":688,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["X_std = X.std(axis=0)\n","X_std"],"execution_count":31,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([0.73950997, 5.91607978])"]},"metadata":{"tags":[]},"execution_count":31}]},{"metadata":{"id":"NkrJolWUw_U6","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":85},"outputId":"96ea8a56-c555-4484-f3eb-ed87b56519da","executionInfo":{"status":"ok","timestamp":1551318159245,"user_tz":-480,"elapsed":669,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["Xs = (X-X_mean)/X_std\n","Xs"],"execution_count":32,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[-1.18321596, -1.18321596],\n","       [-0.50709255, -0.50709255],\n","       [ 0.16903085,  0.16903085],\n","       [ 1.52127766,  1.52127766]])"]},"metadata":{"tags":[]},"execution_count":32}]},{"metadata":{"id":"QM-UY5qbxKN6","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":34},"outputId":"65620cd7-e449-4870-b135-08fad5037f5b","executionInfo":{"status":"ok","timestamp":1551318178937,"user_tz":-480,"elapsed":642,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["Xs.mean(axis =0)"],"execution_count":34,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([0., 0.])"]},"metadata":{"tags":[]},"execution_count":34}]},{"metadata":{"id":"Xp2QS96CxOpQ","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":34},"outputId":"bac2fdc4-3e44-4d91-86c5-0815f1d32660","executionInfo":{"status":"ok","timestamp":1551318205699,"user_tz":-480,"elapsed":688,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["Xs.std(axis=0)"],"execution_count":36,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([1., 1.])"]},"metadata":{"tags":[]},"execution_count":36}]},{"metadata":{"id":"1gITuamIAIsg","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":34},"outputId":"20f2f4e7-0670-451d-e00a-1d8ef625e393","executionInfo":{"status":"ok","timestamp":1551322115836,"user_tz":-480,"elapsed":653,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["Xs.var(axis=1)"],"execution_count":48,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([0., 0., 0., 0.])"]},"metadata":{"tags":[]},"execution_count":48}]},{"metadata":{"id":"q3L4MlCHug8s","colab_type":"text"},"cell_type":"markdown","source":["###  preprocessing.scale"]},{"metadata":{"id":"XxDUmg3JuujP","colab_type":"text"},"cell_type":"markdown","source":["使用sklearn.preprocessing.scale()函数，可以直接将给定数据进行标准化，但不能保存参数，即不能对测试集进行转换"]},{"metadata":{"id":"mxJakcYEu6r5","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":85},"outputId":"37696f75-d52a-44eb-fae3-28ce560bb7bb","executionInfo":{"status":"ok","timestamp":1551317639847,"user_tz":-480,"elapsed":666,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["from sklearn import preprocessing\n","preprocessing.scale(X)\n","#axis =0 . 如果为0，则独立标准化每个特征，否则（如果1）标准化每个样本"],"execution_count":25,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[-1.18321596, -1.18321596],\n","       [-0.50709255, -0.50709255],\n","       [ 0.16903085,  0.16903085],\n","       [ 1.52127766,  1.52127766]])"]},"metadata":{"tags":[]},"execution_count":25}]},{"metadata":{"id":"C1AT268oCwGN","colab_type":"text"},"cell_type":"markdown","source":["## 2缺失值"]},{"metadata":{"id":"0uH2i8nCCo0Q","colab_type":"code","outputId":"bfd1c742-7477-4cfa-c087-1261d7b2255a","executionInfo":{"status":"ok","timestamp":1546004487114,"user_tz":-480,"elapsed":844,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":204}},"cell_type":"code","source":["import pandas as pd\n","data = pd.read_csv(\"./Narrativedata.csv\",index_col=0)\n","data.head()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>Age</th>\n","      <th>Sex</th>\n","      <th>Embarked</th>\n","      <th>Survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>22.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>No</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>38.0</td>\n","      <td>female</td>\n","      <td>C</td>\n","      <td>Yes</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>26.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>Yes</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>35.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>Yes</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>35.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>No</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    Age     Sex Embarked Survived\n","0  22.0    male        S       No\n","1  38.0  female        C      Yes\n","2  26.0  female        S      Yes\n","3  35.0  female        S      Yes\n","4  35.0    male        S       No"]},"metadata":{"tags":[]},"execution_count":19}]},{"metadata":{"id":"-hDmzFR3DLqS","colab_type":"text"},"cell_type":"markdown","source":["### impute.SimpleImputer"]},{"metadata":{"id":"nFUCW1JeDFf9","colab_type":"code","outputId":"962204b7-f709-4115-e18b-03c123f7b1f6","executionInfo":{"status":"ok","timestamp":1546004530642,"user_tz":-480,"elapsed":699,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":170}},"cell_type":"code","source":["data.info()"],"execution_count":0,"outputs":[{"output_type":"stream","text":["<class 'pandas.core.frame.DataFrame'>\n","Int64Index: 891 entries, 0 to 890\n","Data columns (total 4 columns):\n","Age         714 non-null float64\n","Sex         891 non-null object\n","Embarked    889 non-null object\n","Survived    891 non-null object\n","dtypes: float64(1), object(3)\n","memory usage: 34.8+ KB\n"],"name":"stdout"}]},{"metadata":{"id":"Vp98SUBoDQJ_","colab_type":"code","outputId":"fc4b7ceb-7130-48df-9cd3-8925ac562fd2","executionInfo":{"status":"ok","timestamp":1546004548911,"user_tz":-480,"elapsed":816,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":357}},"cell_type":"code","source":["#填补年龄\n","Age = data.loc[:,\"Age\"].values.reshape(-1,1) #sklearn当中特征矩阵必须是二维\n","Age[:20]"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[22.],\n","       [38.],\n","       [26.],\n","       [35.],\n","       [35.],\n","       [nan],\n","       [54.],\n","       [ 2.],\n","       [27.],\n","       [14.],\n","       [ 4.],\n","       [58.],\n","       [20.],\n","       [39.],\n","       [14.],\n","       [55.],\n","       [ 2.],\n","       [nan],\n","       [31.],\n","       [nan]])"]},"metadata":{"tags":[]},"execution_count":21}]},{"metadata":{"id":"UjJUB-95DUmc","colab_type":"code","colab":{}},"cell_type":"code","source":["from sklearn.impute import SimpleImputer\n","imp_mean = SimpleImputer() #实例化，默认均值填补\n","imp_median = SimpleImputer(strategy=\"median\") #用中位数填补\n","imp_0 = SimpleImputer(strategy=\"constant\",fill_value=0) #用0填补\n"],"execution_count":0,"outputs":[]},{"metadata":{"id":"qOe6iBMRDhaj","colab_type":"code","outputId":"2c913388-39b7-4d43-9d28-4b7348e6b1e2","executionInfo":{"status":"ok","timestamp":1546004620487,"user_tz":-480,"elapsed":555,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":51}},"cell_type":"code","source":["imp_0"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["SimpleImputer(copy=True, fill_value=0, missing_values=nan,\n","       strategy='constant', verbose=0)"]},"metadata":{"tags":[]},"execution_count":23}]},{"metadata":{"colab_type":"code","id":"69Pr9oUxD1VT","colab":{}},"cell_type":"code","source":["imp_mean = imp_mean.fit_transform(Age) #fit_transform一步完成调取结果\n","imp_median = imp_median.fit_transform(Age)"],"execution_count":0,"outputs":[]},{"metadata":{"id":"45v_17iSD2oX","colab_type":"code","outputId":"9f1f3b57-47e9-436a-e51c-a232899e4ed0","executionInfo":{"status":"ok","timestamp":1546004753439,"user_tz":-480,"elapsed":743,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":15164}},"cell_type":"code","source":["imp_0 = imp_0.fit_transform(Age)\n","imp_0"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[22.  ],\n","       [38.  ],\n","       [26.  ],\n","       [35.  ],\n","       [35.  ],\n","       [ 0.  ],\n","       [54.  ],\n","       [ 2.  ],\n","       [27.  ],\n","       [14.  ],\n","       [ 4.  ],\n","       [58.  ],\n","       [20.  ],\n","       [39.  ],\n","       [14.  ],\n","       [55.  ],\n","       [ 2.  ],\n","       [ 0.  ],\n","       [31.  ],\n","       [ 0.  ],\n","       [35.  ],\n","       [34.  ],\n","       [15.  ],\n","       [28.  ],\n","       [ 8.  ],\n","       [38.  ],\n","       [ 0.  ],\n","       [19.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [40.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [66.  ],\n","       [28.  ],\n","       [42.  ],\n","       [ 0.  ],\n","       [21.  ],\n","       [18.  ],\n","       [14.  ],\n","       [40.  ],\n","       [27.  ],\n","       [ 0.  ],\n","       [ 3.  ],\n","       [19.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [18.  ],\n","       [ 7.  ],\n","       [21.  ],\n","       [49.  ],\n","       [29.  ],\n","       [65.  ],\n","       [ 0.  ],\n","       [21.  ],\n","       [28.5 ],\n","       [ 5.  ],\n","       [11.  ],\n","       [22.  ],\n","       [38.  ],\n","       [45.  ],\n","       [ 4.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [29.  ],\n","       [19.  ],\n","       [17.  ],\n","       [26.  ],\n","       [32.  ],\n","       [16.  ],\n","       [21.  ],\n","       [26.  ],\n","       [32.  ],\n","       [25.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [ 0.83],\n","       [30.  ],\n","       [22.  ],\n","       [29.  ],\n","       [ 0.  ],\n","       [28.  ],\n","       [17.  ],\n","       [33.  ],\n","       [16.  ],\n","       [ 0.  ],\n","       [23.  ],\n","       [24.  ],\n","       [29.  ],\n","       [20.  ],\n","       [46.  ],\n","       [26.  ],\n","       [59.  ],\n","       [ 0.  ],\n","       [71.  ],\n","       [23.  ],\n","       [34.  ],\n","       [34.  ],\n","       [28.  ],\n","       [ 0.  ],\n","       [21.  ],\n","       [33.  ],\n","       [37.  ],\n","       [28.  ],\n","       [21.  ],\n","       [ 0.  ],\n","       [38.  ],\n","       [ 0.  ],\n","       [47.  ],\n","       [14.5 ],\n","       [22.  ],\n","       [20.  ],\n","       [17.  ],\n","       [21.  ],\n","       [70.5 ],\n","       [29.  ],\n","       [24.  ],\n","       [ 2.  ],\n","       [21.  ],\n","       [ 0.  ],\n","       [32.5 ],\n","       [32.5 ],\n","       [54.  ],\n","       [12.  ],\n","       [ 0.  ],\n","       [24.  ],\n","       [ 0.  ],\n","       [45.  ],\n","       [33.  ],\n","       [20.  ],\n","       [47.  ],\n","       [29.  ],\n","       [25.  ],\n","       [23.  ],\n","       [19.  ],\n","       [37.  ],\n","       [16.  ],\n","       [24.  ],\n","       [ 0.  ],\n","       [22.  ],\n","       [24.  ],\n","       [19.  ],\n","       [18.  ],\n","       [19.  ],\n","       [27.  ],\n","       [ 9.  ],\n","       [36.5 ],\n","       [42.  ],\n","       [51.  ],\n","       [22.  ],\n","       [55.5 ],\n","       [40.5 ],\n","       [ 0.  ],\n","       [51.  ],\n","       [16.  ],\n","       [30.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [44.  ],\n","       [40.  ],\n","       [26.  ],\n","       [17.  ],\n","       [ 1.  ],\n","       [ 9.  ],\n","       [ 0.  ],\n","       [45.  ],\n","       [ 0.  ],\n","       [28.  ],\n","       [61.  ],\n","       [ 4.  ],\n","       [ 1.  ],\n","       [21.  ],\n","       [56.  ],\n","       [18.  ],\n","       [ 0.  ],\n","       [50.  ],\n","       [30.  ],\n","       [36.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [ 9.  ],\n","       [ 1.  ],\n","       [ 4.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [45.  ],\n","       [40.  ],\n","       [36.  ],\n","       [32.  ],\n","       [19.  ],\n","       [19.  ],\n","       [ 3.  ],\n","       [44.  ],\n","       [58.  ],\n","       [ 0.  ],\n","       [42.  ],\n","       [ 0.  ],\n","       [24.  ],\n","       [28.  ],\n","       [ 0.  ],\n","       [34.  ],\n","       [45.5 ],\n","       [18.  ],\n","       [ 2.  ],\n","       [32.  ],\n","       [26.  ],\n","       [16.  ],\n","       [40.  ],\n","       [24.  ],\n","       [35.  ],\n","       [22.  ],\n","       [30.  ],\n","       [ 0.  ],\n","       [31.  ],\n","       [27.  ],\n","       [42.  ],\n","       [32.  ],\n","       [30.  ],\n","       [16.  ],\n","       [27.  ],\n","       [51.  ],\n","       [ 0.  ],\n","       [38.  ],\n","       [22.  ],\n","       [19.  ],\n","       [20.5 ],\n","       [18.  ],\n","       [ 0.  ],\n","       [35.  ],\n","       [29.  ],\n","       [59.  ],\n","       [ 5.  ],\n","       [24.  ],\n","       [ 0.  ],\n","       [44.  ],\n","       [ 8.  ],\n","       [19.  ],\n","       [33.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [29.  ],\n","       [22.  ],\n","       [30.  ],\n","       [44.  ],\n","       [25.  ],\n","       [24.  ],\n","       [37.  ],\n","       [54.  ],\n","       [ 0.  ],\n","       [29.  ],\n","       [62.  ],\n","       [30.  ],\n","       [41.  ],\n","       [29.  ],\n","       [ 0.  ],\n","       [30.  ],\n","       [35.  ],\n","       [50.  ],\n","       [ 0.  ],\n","       [ 3.  ],\n","       [52.  ],\n","       [40.  ],\n","       [ 0.  ],\n","       [36.  ],\n","       [16.  ],\n","       [25.  ],\n","       [58.  ],\n","       [35.  ],\n","       [ 0.  ],\n","       [25.  ],\n","       [41.  ],\n","       [37.  ],\n","       [ 0.  ],\n","       [63.  ],\n","       [45.  ],\n","       [ 0.  ],\n","       [ 7.  ],\n","       [35.  ],\n","       [65.  ],\n","       [28.  ],\n","       [16.  ],\n","       [19.  ],\n","       [ 0.  ],\n","       [33.  ],\n","       [30.  ],\n","       [22.  ],\n","       [42.  ],\n","       [22.  ],\n","       [26.  ],\n","       [19.  ],\n","       [36.  ],\n","       [24.  ],\n","       [24.  ],\n","       [ 0.  ],\n","       [23.5 ],\n","       [ 2.  ],\n","       [ 0.  ],\n","       [50.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [19.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [ 0.92],\n","       [ 0.  ],\n","       [17.  ],\n","       [30.  ],\n","       [30.  ],\n","       [24.  ],\n","       [18.  ],\n","       [26.  ],\n","       [28.  ],\n","       [43.  ],\n","       [26.  ],\n","       [24.  ],\n","       [54.  ],\n","       [31.  ],\n","       [40.  ],\n","       [22.  ],\n","       [27.  ],\n","       [30.  ],\n","       [22.  ],\n","       [ 0.  ],\n","       [36.  ],\n","       [61.  ],\n","       [36.  ],\n","       [31.  ],\n","       [16.  ],\n","       [ 0.  ],\n","       [45.5 ],\n","       [38.  ],\n","       [16.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [29.  ],\n","       [41.  ],\n","       [45.  ],\n","       [45.  ],\n","       [ 2.  ],\n","       [24.  ],\n","       [28.  ],\n","       [25.  ],\n","       [36.  ],\n","       [24.  ],\n","       [40.  ],\n","       [ 0.  ],\n","       [ 3.  ],\n","       [42.  ],\n","       [23.  ],\n","       [ 0.  ],\n","       [15.  ],\n","       [25.  ],\n","       [ 0.  ],\n","       [28.  ],\n","       [22.  ],\n","       [38.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [40.  ],\n","       [29.  ],\n","       [45.  ],\n","       [35.  ],\n","       [ 0.  ],\n","       [30.  ],\n","       [60.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [24.  ],\n","       [25.  ],\n","       [18.  ],\n","       [19.  ],\n","       [22.  ],\n","       [ 3.  ],\n","       [ 0.  ],\n","       [22.  ],\n","       [27.  ],\n","       [20.  ],\n","       [19.  ],\n","       [42.  ],\n","       [ 1.  ],\n","       [32.  ],\n","       [35.  ],\n","       [ 0.  ],\n","       [18.  ],\n","       [ 1.  ],\n","       [36.  ],\n","       [ 0.  ],\n","       [17.  ],\n","       [36.  ],\n","       [21.  ],\n","       [28.  ],\n","       [23.  ],\n","       [24.  ],\n","       [22.  ],\n","       [31.  ],\n","       [46.  ],\n","       [23.  ],\n","       [28.  ],\n","       [39.  ],\n","       [26.  ],\n","       [21.  ],\n","       [28.  ],\n","       [20.  ],\n","       [34.  ],\n","       [51.  ],\n","       [ 3.  ],\n","       [21.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [33.  ],\n","       [ 0.  ],\n","       [44.  ],\n","       [ 0.  ],\n","       [34.  ],\n","       [18.  ],\n","       [30.  ],\n","       [10.  ],\n","       [ 0.  ],\n","       [21.  ],\n","       [29.  ],\n","       [28.  ],\n","       [18.  ],\n","       [ 0.  ],\n","       [28.  ],\n","       [19.  ],\n","       [ 0.  ],\n","       [32.  ],\n","       [28.  ],\n","       [ 0.  ],\n","       [42.  ],\n","       [17.  ],\n","       [50.  ],\n","       [14.  ],\n","       [21.  ],\n","       [24.  ],\n","       [64.  ],\n","       [31.  ],\n","       [45.  ],\n","       [20.  ],\n","       [25.  ],\n","       [28.  ],\n","       [ 0.  ],\n","       [ 4.  ],\n","       [13.  ],\n","       [34.  ],\n","       [ 5.  ],\n","       [52.  ],\n","       [36.  ],\n","       [ 0.  ],\n","       [30.  ],\n","       [49.  ],\n","       [ 0.  ],\n","       [29.  ],\n","       [65.  ],\n","       [ 0.  ],\n","       [50.  ],\n","       [ 0.  ],\n","       [48.  ],\n","       [34.  ],\n","       [47.  ],\n","       [48.  ],\n","       [ 0.  ],\n","       [38.  ],\n","       [ 0.  ],\n","       [56.  ],\n","       [ 0.  ],\n","       [ 0.75],\n","       [ 0.  ],\n","       [38.  ],\n","       [33.  ],\n","       [23.  ],\n","       [22.  ],\n","       [ 0.  ],\n","       [34.  ],\n","       [29.  ],\n","       [22.  ],\n","       [ 2.  ],\n","       [ 9.  ],\n","       [ 0.  ],\n","       [50.  ],\n","       [63.  ],\n","       [25.  ],\n","       [ 0.  ],\n","       [35.  ],\n","       [58.  ],\n","       [30.  ],\n","       [ 9.  ],\n","       [ 0.  ],\n","       [21.  ],\n","       [55.  ],\n","       [71.  ],\n","       [21.  ],\n","       [ 0.  ],\n","       [54.  ],\n","       [ 0.  ],\n","       [25.  ],\n","       [24.  ],\n","       [17.  ],\n","       [21.  ],\n","       [ 0.  ],\n","       [37.  ],\n","       [16.  ],\n","       [18.  ],\n","       [33.  ],\n","       [ 0.  ],\n","       [28.  ],\n","       [26.  ],\n","       [29.  ],\n","       [ 0.  ],\n","       [36.  ],\n","       [54.  ],\n","       [24.  ],\n","       [47.  ],\n","       [34.  ],\n","       [ 0.  ],\n","       [36.  ],\n","       [32.  ],\n","       [30.  ],\n","       [22.  ],\n","       [ 0.  ],\n","       [44.  ],\n","       [ 0.  ],\n","       [40.5 ],\n","       [50.  ],\n","       [ 0.  ],\n","       [39.  ],\n","       [23.  ],\n","       [ 2.  ],\n","       [ 0.  ],\n","       [17.  ],\n","       [ 0.  ],\n","       [30.  ],\n","       [ 7.  ],\n","       [45.  ],\n","       [30.  ],\n","       [ 0.  ],\n","       [22.  ],\n","       [36.  ],\n","       [ 9.  ],\n","       [11.  ],\n","       [32.  ],\n","       [50.  ],\n","       [64.  ],\n","       [19.  ],\n","       [ 0.  ],\n","       [33.  ],\n","       [ 8.  ],\n","       [17.  ],\n","       [27.  ],\n","       [ 0.  ],\n","       [22.  ],\n","       [22.  ],\n","       [62.  ],\n","       [48.  ],\n","       [ 0.  ],\n","       [39.  ],\n","       [36.  ],\n","       [ 0.  ],\n","       [40.  ],\n","       [28.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [24.  ],\n","       [19.  ],\n","       [29.  ],\n","       [ 0.  ],\n","       [32.  ],\n","       [62.  ],\n","       [53.  ],\n","       [36.  ],\n","       [ 0.  ],\n","       [16.  ],\n","       [19.  ],\n","       [34.  ],\n","       [39.  ],\n","       [ 0.  ],\n","       [32.  ],\n","       [25.  ],\n","       [39.  ],\n","       [54.  ],\n","       [36.  ],\n","       [ 0.  ],\n","       [18.  ],\n","       [47.  ],\n","       [60.  ],\n","       [22.  ],\n","       [ 0.  ],\n","       [35.  ],\n","       [52.  ],\n","       [47.  ],\n","       [ 0.  ],\n","       [37.  ],\n","       [36.  ],\n","       [ 0.  ],\n","       [49.  ],\n","       [ 0.  ],\n","       [49.  ],\n","       [24.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [44.  ],\n","       [35.  ],\n","       [36.  ],\n","       [30.  ],\n","       [27.  ],\n","       [22.  ],\n","       [40.  ],\n","       [39.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [35.  ],\n","       [24.  ],\n","       [34.  ],\n","       [26.  ],\n","       [ 4.  ],\n","       [26.  ],\n","       [27.  ],\n","       [42.  ],\n","       [20.  ],\n","       [21.  ],\n","       [21.  ],\n","       [61.  ],\n","       [57.  ],\n","       [21.  ],\n","       [26.  ],\n","       [ 0.  ],\n","       [80.  ],\n","       [51.  ],\n","       [32.  ],\n","       [ 0.  ],\n","       [ 9.  ],\n","       [28.  ],\n","       [32.  ],\n","       [31.  ],\n","       [41.  ],\n","       [ 0.  ],\n","       [20.  ],\n","       [24.  ],\n","       [ 2.  ],\n","       [ 0.  ],\n","       [ 0.75],\n","       [48.  ],\n","       [19.  ],\n","       [56.  ],\n","       [ 0.  ],\n","       [23.  ],\n","       [ 0.  ],\n","       [18.  ],\n","       [21.  ],\n","       [ 0.  ],\n","       [18.  ],\n","       [24.  ],\n","       [ 0.  ],\n","       [32.  ],\n","       [23.  ],\n","       [58.  ],\n","       [50.  ],\n","       [40.  ],\n","       [47.  ],\n","       [36.  ],\n","       [20.  ],\n","       [32.  ],\n","       [25.  ],\n","       [ 0.  ],\n","       [43.  ],\n","       [ 0.  ],\n","       [40.  ],\n","       [31.  ],\n","       [70.  ],\n","       [31.  ],\n","       [ 0.  ],\n","       [18.  ],\n","       [24.5 ],\n","       [18.  ],\n","       [43.  ],\n","       [36.  ],\n","       [ 0.  ],\n","       [27.  ],\n","       [20.  ],\n","       [14.  ],\n","       [60.  ],\n","       [25.  ],\n","       [14.  ],\n","       [19.  ],\n","       [18.  ],\n","       [15.  ],\n","       [31.  ],\n","       [ 4.  ],\n","       [ 0.  ],\n","       [25.  ],\n","       [60.  ],\n","       [52.  ],\n","       [44.  ],\n","       [ 0.  ],\n","       [49.  ],\n","       [42.  ],\n","       [18.  ],\n","       [35.  ],\n","       [18.  ],\n","       [25.  ],\n","       [26.  ],\n","       [39.  ],\n","       [45.  ],\n","       [42.  ],\n","       [22.  ],\n","       [ 0.  ],\n","       [24.  ],\n","       [ 0.  ],\n","       [48.  ],\n","       [29.  ],\n","       [52.  ],\n","       [19.  ],\n","       [38.  ],\n","       [27.  ],\n","       [ 0.  ],\n","       [33.  ],\n","       [ 6.  ],\n","       [17.  ],\n","       [34.  ],\n","       [50.  ],\n","       [27.  ],\n","       [20.  ],\n","       [30.  ],\n","       [ 0.  ],\n","       [25.  ],\n","       [25.  ],\n","       [29.  ],\n","       [11.  ],\n","       [ 0.  ],\n","       [23.  ],\n","       [23.  ],\n","       [28.5 ],\n","       [48.  ],\n","       [35.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [36.  ],\n","       [21.  ],\n","       [24.  ],\n","       [31.  ],\n","       [70.  ],\n","       [16.  ],\n","       [30.  ],\n","       [19.  ],\n","       [31.  ],\n","       [ 4.  ],\n","       [ 6.  ],\n","       [33.  ],\n","       [23.  ],\n","       [48.  ],\n","       [ 0.67],\n","       [28.  ],\n","       [18.  ],\n","       [34.  ],\n","       [33.  ],\n","       [ 0.  ],\n","       [41.  ],\n","       [20.  ],\n","       [36.  ],\n","       [16.  ],\n","       [51.  ],\n","       [ 0.  ],\n","       [30.5 ],\n","       [ 0.  ],\n","       [32.  ],\n","       [24.  ],\n","       [48.  ],\n","       [57.  ],\n","       [ 0.  ],\n","       [54.  ],\n","       [18.  ],\n","       [ 0.  ],\n","       [ 5.  ],\n","       [ 0.  ],\n","       [43.  ],\n","       [13.  ],\n","       [17.  ],\n","       [29.  ],\n","       [ 0.  ],\n","       [25.  ],\n","       [25.  ],\n","       [18.  ],\n","       [ 8.  ],\n","       [ 1.  ],\n","       [46.  ],\n","       [ 0.  ],\n","       [16.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [25.  ],\n","       [39.  ],\n","       [49.  ],\n","       [31.  ],\n","       [30.  ],\n","       [30.  ],\n","       [34.  ],\n","       [31.  ],\n","       [11.  ],\n","       [ 0.42],\n","       [27.  ],\n","       [31.  ],\n","       [39.  ],\n","       [18.  ],\n","       [39.  ],\n","       [33.  ],\n","       [26.  ],\n","       [39.  ],\n","       [35.  ],\n","       [ 6.  ],\n","       [30.5 ],\n","       [ 0.  ],\n","       [23.  ],\n","       [31.  ],\n","       [43.  ],\n","       [10.  ],\n","       [52.  ],\n","       [27.  ],\n","       [38.  ],\n","       [27.  ],\n","       [ 2.  ],\n","       [ 0.  ],\n","       [ 0.  ],\n","       [ 1.  ],\n","       [ 0.  ],\n","       [62.  ],\n","       [15.  ],\n","       [ 0.83],\n","       [ 0.  ],\n","       [23.  ],\n","       [18.  ],\n","       [39.  ],\n","       [21.  ],\n","       [ 0.  ],\n","       [32.  ],\n","       [ 0.  ],\n","       [20.  ],\n","       [16.  ],\n","       [30.  ],\n","       [34.5 ],\n","       [17.  ],\n","       [42.  ],\n","       [ 0.  ],\n","       [35.  ],\n","       [28.  ],\n","       [ 0.  ],\n","       [ 4.  ],\n","       [74.  ],\n","       [ 9.  ],\n","       [16.  ],\n","       [44.  ],\n","       [18.  ],\n","       [45.  ],\n","       [51.  ],\n","       [24.  ],\n","       [ 0.  ],\n","       [41.  ],\n","       [21.  ],\n","       [48.  ],\n","       [ 0.  ],\n","       [24.  ],\n","       [42.  ],\n","       [27.  ],\n","       [31.  ],\n","       [ 0.  ],\n","       [ 4.  ],\n","       [26.  ],\n","       [47.  ],\n","       [33.  ],\n","       [47.  ],\n","       [28.  ],\n","       [15.  ],\n","       [20.  ],\n","       [19.  ],\n","       [ 0.  ],\n","       [56.  ],\n","       [25.  ],\n","       [33.  ],\n","       [22.  ],\n","       [28.  ],\n","       [25.  ],\n","       [39.  ],\n","       [27.  ],\n","       [19.  ],\n","       [ 0.  ],\n","       [26.  ],\n","       [32.  ]])"]},"metadata":{"tags":[]},"execution_count":25}]},{"metadata":{"id":"KQBKI2_LECK9","colab_type":"code","outputId":"c831befa-75d8-471d-93ce-e17b2b9aa5ed","executionInfo":{"status":"ok","timestamp":1546004768364,"user_tz":-480,"elapsed":807,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":357}},"cell_type":"code","source":["imp_mean[:20]\n"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[22.        ],\n","       [38.        ],\n","       [26.        ],\n","       [35.        ],\n","       [35.        ],\n","       [29.69911765],\n","       [54.        ],\n","       [ 2.        ],\n","       [27.        ],\n","       [14.        ],\n","       [ 4.        ],\n","       [58.        ],\n","       [20.        ],\n","       [39.        ],\n","       [14.        ],\n","       [55.        ],\n","       [ 2.        ],\n","       [29.69911765],\n","       [31.        ],\n","       [29.69911765]])"]},"metadata":{"tags":[]},"execution_count":26}]},{"metadata":{"id":"pxHR1k4LEJtN","colab_type":"code","outputId":"9e894b62-32a1-42e1-c098-3bcfeeb8b71a","executionInfo":{"status":"ok","timestamp":1546004778430,"user_tz":-480,"elapsed":920,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":357}},"cell_type":"code","source":["imp_median[:20]\n"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[22.],\n","       [38.],\n","       [26.],\n","       [35.],\n","       [35.],\n","       [28.],\n","       [54.],\n","       [ 2.],\n","       [27.],\n","       [14.],\n","       [ 4.],\n","       [58.],\n","       [20.],\n","       [39.],\n","       [14.],\n","       [55.],\n","       [ 2.],\n","       [28.],\n","       [31.],\n","       [28.]])"]},"metadata":{"tags":[]},"execution_count":27}]},{"metadata":{"colab_type":"code","id":"VAp7bvEPEOoT","outputId":"c56bd3b4-b9ea-4ae6-cef0-c2a7a6117293","executionInfo":{"status":"ok","timestamp":1546004795634,"user_tz":-480,"elapsed":758,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":357}},"cell_type":"code","source":["imp_0[:20]\n"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[22.],\n","       [38.],\n","       [26.],\n","       [35.],\n","       [35.],\n","       [ 0.],\n","       [54.],\n","       [ 2.],\n","       [27.],\n","       [14.],\n","       [ 4.],\n","       [58.],\n","       [20.],\n","       [39.],\n","       [14.],\n","       [55.],\n","       [ 2.],\n","       [ 0.],\n","       [31.],\n","       [ 0.]])"]},"metadata":{"tags":[]},"execution_count":28}]},{"metadata":{"id":"z24ECd9bEQNA","colab_type":"code","outputId":"81a364c7-e87f-456b-dcc8-0751a1854ac8","executionInfo":{"status":"ok","timestamp":1546004803324,"user_tz":-480,"elapsed":1691,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":170}},"cell_type":"code","source":["#在这里我们使用中位数填补Age\n","data.loc[:,\"Age\"] = imp_median\n","data.info()\n"],"execution_count":0,"outputs":[{"output_type":"stream","text":["<class 'pandas.core.frame.DataFrame'>\n","Int64Index: 891 entries, 0 to 890\n","Data columns (total 4 columns):\n","Age         891 non-null float64\n","Sex         891 non-null object\n","Embarked    889 non-null object\n","Survived    891 non-null object\n","dtypes: float64(1), object(3)\n","memory usage: 34.8+ KB\n"],"name":"stdout"}]},{"metadata":{"id":"ngsr85w8ESFS","colab_type":"code","outputId":"7ced5d21-a7ad-4451-fbee-4deec0ac131f","executionInfo":{"status":"ok","timestamp":1546004829012,"user_tz":-480,"elapsed":900,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":170}},"cell_type":"code","source":["#使用众数填补Embarked\n","Embarked = data.loc[:,\"Embarked\"].values.reshape(-1,1)\n","imp_mode = SimpleImputer(strategy = \"most_frequent\")\n","data.loc[:,\"Embarked\"] = imp_mode.fit_transform(Embarked)\n","data.info()"],"execution_count":0,"outputs":[{"output_type":"stream","text":["<class 'pandas.core.frame.DataFrame'>\n","Int64Index: 891 entries, 0 to 890\n","Data columns (total 4 columns):\n","Age         891 non-null float64\n","Sex         891 non-null object\n","Embarked    891 non-null object\n","Survived    891 non-null object\n","dtypes: float64(1), object(3)\n","memory usage: 34.8+ KB\n"],"name":"stdout"}]},{"metadata":{"id":"3Gp3JaiTEiab","colab_type":"text"},"cell_type":"markdown","source":["#### 用Pandas和Numpy进行填补其实更加简单"]},{"metadata":{"id":"CqbSKKT5EY9p","colab_type":"code","outputId":"0d626ea9-ed89-4282-f01b-8ab6d2385b47","executionInfo":{"status":"ok","timestamp":1546004922045,"user_tz":-480,"elapsed":865,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":204}},"cell_type":"code","source":["import pandas as pd\n","data = pd.read_csv(r\"Narrativedata.csv\",index_col=0)\n","data.head()\n"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>Age</th>\n","      <th>Sex</th>\n","      <th>Embarked</th>\n","      <th>Survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>22.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>No</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>38.0</td>\n","      <td>female</td>\n","      <td>C</td>\n","      <td>Yes</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>26.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>Yes</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>35.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>Yes</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>35.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>No</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    Age     Sex Embarked Survived\n","0  22.0    male        S       No\n","1  38.0  female        C      Yes\n","2  26.0  female        S      Yes\n","3  35.0  female        S      Yes\n","4  35.0    male        S       No"]},"metadata":{"tags":[]},"execution_count":31}]},{"metadata":{"id":"hK4ZEYVJEvF1","colab_type":"code","colab":{}},"cell_type":"code","source":["data.loc[:,\"Age\"] = data.loc[:,\"Age\"].fillna(data.loc[:,\"Age\"].median())\n","#.fillna 在DataFrame里面直接进行填补\n","data.dropna(axis=0,inplace=True)\n","#.dropna(axis=0)删除所有有缺失值的行，.dropna(axis=1)删除所有有缺失值的列\n","#参数inplace，为True表示在原数据集上进行修改，为False表示生成一个复制对象，不修改原数据，默认False"],"execution_count":0,"outputs":[]},{"metadata":{"id":"JVmDBWC9Ey70","colab_type":"code","outputId":"8ee4ee3f-a1f5-4a90-fba8-3ea959477f58","executionInfo":{"status":"ok","timestamp":1546004956877,"user_tz":-480,"elapsed":1006,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":170}},"cell_type":"code","source":["data.info()"],"execution_count":0,"outputs":[{"output_type":"stream","text":["<class 'pandas.core.frame.DataFrame'>\n","Int64Index: 889 entries, 0 to 890\n","Data columns (total 4 columns):\n","Age         889 non-null float64\n","Sex         889 non-null object\n","Embarked    889 non-null object\n","Survived    889 non-null object\n","dtypes: float64(1), object(3)\n","memory usage: 34.7+ KB\n"],"name":"stdout"}]},{"metadata":{"id":"bKFrDyf9FA4Z","colab_type":"text"},"cell_type":"markdown","source":["## 3处理分类型特征：编码与哑变量"]},{"metadata":{"id":"nIX4lSmohdxz","colab_type":"text"},"cell_type":"markdown","source":["### LabelEncoder标签专用"]},{"metadata":{"id":"1QaaoLqEE4J6","colab_type":"code","colab":{}},"cell_type":"code","source":["from sklearn.preprocessing import LabelEncoder\n","y = data.iloc[:,-1] #要输入的是标签，不是特征矩阵，所以允许一维\n","le = LabelEncoder() #实例化\n","le = le.fit(y) #导入数据\n","label = le.transform(y) #transform接口调取结果"],"execution_count":0,"outputs":[]},{"metadata":{"id":"v4Q6i55qFTAU","colab_type":"code","outputId":"cebaea77-a586-41c2-a211-ebb1c1667369","executionInfo":{"status":"ok","timestamp":1546005086001,"user_tz":-480,"elapsed":750,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["le.classes_ #属性.classes_查看标签中究竟有多少类别"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array(['No', 'Unknown', 'Yes'], dtype=object)"]},"metadata":{"tags":[]},"execution_count":35}]},{"metadata":{"id":"aS1fStxNFWbZ","colab_type":"code","outputId":"1db61567-ad34-4399-a8ec-db19a3c4411d","executionInfo":{"status":"ok","timestamp":1546005097515,"user_tz":-480,"elapsed":748,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":714}},"cell_type":"code","source":["label #查看获取的结果label"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([0, 2, 2, 2, 0, 0, 0, 0, 2, 2, 1, 2, 0, 0, 0, 1, 0, 2, 0, 2, 1, 2,\n","       2, 2, 0, 1, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 1,\n","       2, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, 2, 0, 0, 0, 0, 0, 2, 2,\n","       0, 2, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 2, 0, 2, 2, 0, 2, 2, 0, 0, 2,\n","       0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 0,\n","       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 1, 0, 0,\n","       2, 0, 0, 2, 0, 0, 0, 1, 1, 2, 0, 0, 0, 2, 0, 0, 1, 0, 1, 1, 0, 0,\n","       0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 2, 0, 0, 0, 1, 0, 2, 0, 0, 0, 1,\n","       0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 2, 0, 0, 2, 0, 2, 1, 2, 2, 0, 0, 1,\n","       0, 0, 0, 0, 0, 2, 0, 0, 2, 2, 2, 1, 2, 1, 0, 0, 2, 2, 0, 2, 0, 2,\n","       0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 1, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0,\n","       0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 1, 0, 2, 2, 2, 2, 2, 0, 2, 0, 1, 0,\n","       0, 1, 2, 2, 1, 0, 2, 2, 0, 2, 2, 0, 0, 1, 1, 0, 0, 0, 2, 0, 0, 2,\n","       0, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 1, 2, 0, 2, 2, 2, 0,\n","       2, 2, 2, 0, 0, 0, 2, 2, 1, 2, 2, 0, 1, 2, 2, 0, 2, 0, 1, 2, 2, 2,\n","       0, 1, 0, 2, 0, 0, 2, 1, 0, 2, 2, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0,\n","       0, 0, 0, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 2, 1, 2, 0, 0, 0, 0,\n","       2, 2, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 2, 0, 2, 2, 2, 0, 2, 2, 0, 0,\n","       0, 0, 2, 2, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 2, 0, 2, 0, 1, 2, 0,\n","       0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 2, 2, 0, 0, 2, 0, 2, 0, 0, 2,\n","       0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 1, 2, 0, 2, 2, 0, 2, 1, 0,\n","       0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 2, 0, 0, 1, 0, 0, 2, 0, 0, 0, 2, 2,\n","       1, 2, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 2, 1, 2,\n","       2, 1, 2, 2, 0, 2, 2, 1, 0, 2, 0, 2, 0, 2, 0, 0, 2, 0, 0, 2, 0, 0,\n","       0, 2, 0, 1, 2, 0, 2, 0, 2, 0, 2, 2, 0, 1, 2, 0, 0, 2, 2, 1, 2, 2,\n","       0, 0, 2, 2, 0, 2, 0, 2, 2, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 2, 2, 1,\n","       2, 0, 0, 2, 2, 0, 2, 2, 2, 0, 0, 0, 2, 0, 2, 1, 0, 0, 2, 0, 0, 0,\n","       0, 2, 0, 0, 2, 2, 0, 0, 0, 2, 0, 1, 2, 2, 1, 0, 0, 2, 0, 0, 1, 0,\n","       0, 2, 0, 0, 2, 2, 0, 0, 0, 1, 2, 1, 0, 1, 0, 2, 0, 0, 2, 0, 0, 0,\n","       0, 0, 2, 0, 2, 2, 2, 1, 2, 0, 2, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 1,\n","       0, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0,\n","       0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 2, 0, 0, 2, 2, 0, 0, 0,\n","       0, 1, 2, 2, 2, 2, 0, 1, 0, 1, 1, 2, 1, 0, 0, 2, 0, 0, 0, 2, 0, 2,\n","       2, 1, 1, 2, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 0, 2, 0, 2, 0, 0, 2, 0,\n","       0, 2, 2, 1, 0, 2, 2, 0, 0, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0, 0,\n","       1, 0, 0, 1, 1, 0, 2, 0, 2, 2, 2, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0,\n","       0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 2, 0, 1, 0, 1, 0,\n","       0, 0, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 2, 0, 0,\n","       2, 2, 0, 0, 2, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 2, 0, 2, 2, 2, 2, 0,\n","       0, 0, 2, 0, 1, 1, 1, 0, 0, 2, 0, 1, 0, 0, 2, 2, 0, 0, 0, 2, 2, 0,\n","       0, 1, 0, 0, 0, 2, 0, 1, 0])"]},"metadata":{"tags":[]},"execution_count":36}]},{"metadata":{"id":"211bqiMCFaA9","colab_type":"code","outputId":"2c50fa3e-bed1-4990-afda-df4d5e631639","executionInfo":{"status":"ok","timestamp":1546005153380,"user_tz":-480,"elapsed":753,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":714}},"cell_type":"code","source":["le.fit_transform(y) #也可以直接fit_transform一步到位\n"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([0, 2, 2, 2, 0, 0, 0, 0, 2, 2, 1, 2, 0, 0, 0, 1, 0, 2, 0, 2, 1, 2,\n","       2, 2, 0, 1, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 1,\n","       2, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, 2, 0, 0, 0, 0, 0, 2, 2,\n","       0, 2, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 2, 0, 2, 2, 0, 2, 2, 0, 0, 2,\n","       0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 0,\n","       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 1, 0, 0,\n","       2, 0, 0, 2, 0, 0, 0, 1, 1, 2, 0, 0, 0, 2, 0, 0, 1, 0, 1, 1, 0, 0,\n","       0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 2, 0, 0, 0, 1, 0, 2, 0, 0, 0, 1,\n","       0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 2, 0, 0, 2, 0, 2, 1, 2, 2, 0, 0, 1,\n","       0, 0, 0, 0, 0, 2, 0, 0, 2, 2, 2, 1, 2, 1, 0, 0, 2, 2, 0, 2, 0, 2,\n","       0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 1, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0,\n","       0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 1, 0, 2, 2, 2, 2, 2, 0, 2, 0, 1, 0,\n","       0, 1, 2, 2, 1, 0, 2, 2, 0, 2, 2, 0, 0, 1, 1, 0, 0, 0, 2, 0, 0, 2,\n","       0, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 1, 2, 0, 2, 2, 2, 0,\n","       2, 2, 2, 0, 0, 0, 2, 2, 1, 2, 2, 0, 1, 2, 2, 0, 2, 0, 1, 2, 2, 2,\n","       0, 1, 0, 2, 0, 0, 2, 1, 0, 2, 2, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0,\n","       0, 0, 0, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 2, 1, 2, 0, 0, 0, 0,\n","       2, 2, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 2, 0, 2, 2, 2, 0, 2, 2, 0, 0,\n","       0, 0, 2, 2, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 2, 0, 2, 0, 1, 2, 0,\n","       0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 2, 2, 0, 0, 2, 0, 2, 0, 0, 2,\n","       0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 1, 2, 0, 2, 2, 0, 2, 1, 0,\n","       0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 2, 0, 0, 1, 0, 0, 2, 0, 0, 0, 2, 2,\n","       1, 2, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 2, 1, 2,\n","       2, 1, 2, 2, 0, 2, 2, 1, 0, 2, 0, 2, 0, 2, 0, 0, 2, 0, 0, 2, 0, 0,\n","       0, 2, 0, 1, 2, 0, 2, 0, 2, 0, 2, 2, 0, 1, 2, 0, 0, 2, 2, 1, 2, 2,\n","       0, 0, 2, 2, 0, 2, 0, 2, 2, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 2, 2, 1,\n","       2, 0, 0, 2, 2, 0, 2, 2, 2, 0, 0, 0, 2, 0, 2, 1, 0, 0, 2, 0, 0, 0,\n","       0, 2, 0, 0, 2, 2, 0, 0, 0, 2, 0, 1, 2, 2, 1, 0, 0, 2, 0, 0, 1, 0,\n","       0, 2, 0, 0, 2, 2, 0, 0, 0, 1, 2, 1, 0, 1, 0, 2, 0, 0, 2, 0, 0, 0,\n","       0, 0, 2, 0, 2, 2, 2, 1, 2, 0, 2, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 1,\n","       0, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0,\n","       0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 2, 0, 0, 2, 2, 0, 0, 0,\n","       0, 1, 2, 2, 2, 2, 0, 1, 0, 1, 1, 2, 1, 0, 0, 2, 0, 0, 0, 2, 0, 2,\n","       2, 1, 1, 2, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 0, 2, 0, 2, 0, 0, 2, 0,\n","       0, 2, 2, 1, 0, 2, 2, 0, 0, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0, 0,\n","       1, 0, 0, 1, 1, 0, 2, 0, 2, 2, 2, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0,\n","       0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 2, 0, 1, 0, 1, 0,\n","       0, 0, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 2, 0, 0,\n","       2, 2, 0, 0, 2, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 2, 0, 2, 2, 2, 2, 0,\n","       0, 0, 2, 0, 1, 1, 1, 0, 0, 2, 0, 1, 0, 0, 2, 2, 0, 0, 0, 2, 2, 0,\n","       0, 1, 0, 0, 0, 2, 0, 1, 0])"]},"metadata":{"tags":[]},"execution_count":37}]},{"metadata":{"id":"zPyoyIriFnpD","colab_type":"code","outputId":"684447c5-6363-46e8-c3ed-a592f04b29c1","executionInfo":{"status":"ok","timestamp":1546005163510,"user_tz":-480,"elapsed":918,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":1632}},"cell_type":"code","source":["le.inverse_transform(label) #使用inverse_transform可以逆转\n"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array(['No', 'Yes', 'Yes', 'Yes', 'No', 'No', 'No', 'No', 'Yes', 'Yes',\n","       'Unknown', 'Yes', 'No', 'No', 'No', 'Unknown', 'No', 'Yes', 'No',\n","       'Yes', 'Unknown', 'Yes', 'Yes', 'Yes', 'No', 'Unknown', 'No', 'No',\n","       'Yes', 'No', 'No', 'Yes', 'Yes', 'No', 'No', 'No', 'Yes', 'No',\n","       'No', 'Yes', 'No', 'No', 'No', 'Unknown', 'Yes', 'No', 'No', 'Yes',\n","       'No', 'No', 'No', 'No', 'Yes', 'Yes', 'No', 'Yes', 'Yes', 'No',\n","       'Yes', 'No', 'No', 'No', 'No', 'No', 'Yes', 'Yes', 'No', 'Yes',\n","       'No', 'No', 'No', 'No', 'No', 'Yes', 'Unknown', 'No', 'Unknown',\n","       'Yes', 'Yes', 'No', 'Yes', 'Yes', 'No', 'Yes', 'Yes', 'No', 'No',\n","       'Yes', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'Unknown', 'Yes',\n","       'Yes', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'Yes', 'Yes',\n","       'No', 'Yes', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No',\n","       'No', 'No', 'No', 'No', 'Yes', 'No', 'Yes', 'No', 'Yes', 'Yes',\n","       'No', 'Unknown', 'No', 'No', 'Yes', 'No', 'No', 'Yes', 'No', 'No',\n","       'No', 'Unknown', 'Unknown', 'Yes', 'No', 'No', 'No', 'Yes', 'No',\n","       'No', 'Unknown', 'No', 'Unknown', 'Unknown', 'No', 'No', 'No',\n","       'Yes', 'No', 'No', 'No', 'No', 'Yes', 'No', 'No', 'No', 'Yes',\n","       'Yes', 'No', 'No', 'No', 'Unknown', 'No', 'Yes', 'No', 'No', 'No',\n","       'Unknown', 'No', 'No', 'No', 'No', 'No', 'No', 'Unknown', 'Yes',\n","       'No', 'Yes', 'Yes', 'No', 'No', 'Yes', 'No', 'Yes', 'Unknown',\n","       'Yes', 'Yes', 'No', 'No', 'Unknown', 'No', 'No', 'No', 'No', 'No',\n","       'Yes', 'No', 'No', 'Yes', 'Yes', 'Yes', 'Unknown', 'Yes',\n","       'Unknown', 'No', 'No', 'Yes', 'Yes', 'No', 'Yes', 'No', 'Yes',\n","       'No', 'No', 'No', 'Yes', 'No', 'Yes', 'No', 'No', 'No', 'Yes',\n","       'Unknown', 'No', 'Yes', 'No', 'No', 'No', 'Yes', 'No', 'No', 'No',\n","       'Yes', 'No', 'No', 'No', 'No', 'No', 'Yes', 'Yes', 'No', 'No',\n","       'No', 'No', 'Unknown', 'No', 'Yes', 'Yes', 'Yes', 'Yes', 'Yes',\n","       'No', 'Yes', 'No', 'Unknown', 'No', 'No', 'Unknown', 'Yes', 'Yes',\n","       'Unknown', 'No', 'Yes', 'Yes', 'No', 'Yes', 'Yes', 'No', 'No',\n","       'Unknown', 'Unknown', 'No', 'No', 'No', 'Yes', 'No', 'No', 'Yes',\n","       'No', 'Yes', 'Yes', 'Yes', 'Yes', 'No', 'No', 'No', 'No', 'No',\n","       'No', 'Yes', 'Yes', 'Yes', 'Yes', 'Unknown', 'Yes', 'No', 'Yes',\n","       'Yes', 'Yes', 'No', 'Yes', 'Yes', 'Yes', 'No', 'No', 'No', 'Yes',\n","       'Yes', 'Unknown', 'Yes', 'Yes', 'No', 'Unknown', 'Yes', 'Yes',\n","       'No', 'Yes', 'No', 'Unknown', 'Yes', 'Yes', 'Yes', 'No', 'Unknown',\n","       'No', 'Yes', 'No', 'No', 'Yes', 'Unknown', 'No', 'Yes', 'Yes',\n","       'No', 'No', 'No', 'Yes', 'Yes', 'Yes', 'Yes', 'No', 'No', 'No',\n","       'No', 'No', 'No', 'No', 'Yes', 'No', 'Yes', 'Yes', 'No', 'No',\n","       'No', 'No', 'No', 'No', 'Yes', 'Yes', 'Yes', 'Unknown', 'Yes',\n","       'No', 'No', 'No', 'No', 'Yes', 'Yes', 'No', 'No', 'No', 'Yes',\n","       'Yes', 'No', 'Yes', 'No', 'No', 'No', 'Yes', 'No', 'Yes', 'Yes',\n","       'Yes', 'No', 'Yes', 'Yes', 'No', 'No', 'No', 'No', 'Yes', 'Yes',\n","       'Unknown', 'No', 'No', 'No', 'Unknown', 'No', 'Yes', 'No', 'No',\n","       'No', 'No', 'Yes', 'No', 'Yes', 'No', 'Unknown', 'Yes', 'No', 'No',\n","       'No', 'No', 'No', 'No', 'No', 'No', 'Yes', 'Yes', 'No', 'Yes',\n","       'Yes', 'Yes', 'Yes', 'No', 'No', 'Yes', 'No', 'Yes', 'No', 'No',\n","       'Yes', 'No', 'No', 'Yes', 'Yes', 'Yes', 'Yes', 'Yes', 'Yes', 'Yes',\n","       'No', 'No', 'No', 'Yes', 'Unknown', 'Yes', 'No', 'Yes', 'Yes',\n","       'No', 'Yes', 'Unknown', 'No', 'No', 'No', 'No', 'No', 'No', 'No',\n","       'Unknown', 'Unknown', 'No', 'Yes', 'Yes', 'No', 'No', 'Unknown',\n","       'No', 'No', 'Yes', 'No', 'No', 'No', 'Yes', 'Yes', 'Unknown',\n","       'Yes', 'No', 'No', 'Unknown', 'No', 'No', 'Unknown', 'No', 'No',\n","       'No', 'Yes', 'Unknown', 'No', 'No', 'No', 'No', 'No', 'No', 'Yes',\n","       'Unknown', 'Yes', 'Yes', 'Unknown', 'Yes', 'Yes', 'No', 'Yes',\n","       'Yes', 'Unknown', 'No', 'Yes', 'No', 'Yes', 'No', 'Yes', 'No',\n","       'No', 'Yes', 'No', 'No', 'Yes', 'No', 'No', 'No', 'Yes', 'No',\n","       'Unknown', 'Yes', 'No', 'Yes', 'No', 'Yes', 'No', 'Yes', 'Yes',\n","       'No', 'Unknown', 'Yes', 'No', 'No', 'Yes', 'Yes', 'Unknown', 'Yes',\n","       'Yes', 'No', 'No', 'Yes', 'Yes', 'No', 'Yes', 'No', 'Yes', 'Yes',\n","       'No', 'No', 'No', 'No', 'Unknown', 'No', 'Unknown', 'No',\n","       'Unknown', 'Unknown', 'Yes', 'Yes', 'Unknown', 'Yes', 'No', 'No',\n","       'Yes', 'Yes', 'No', 'Yes', 'Yes', 'Yes', 'No', 'No', 'No', 'Yes',\n","       'No', 'Yes', 'Unknown', 'No', 'No', 'Yes', 'No', 'No', 'No', 'No',\n","       'Yes', 'No', 'No', 'Yes', 'Yes', 'No', 'No', 'No', 'Yes', 'No',\n","       'Unknown', 'Yes', 'Yes', 'Unknown', 'No', 'No', 'Yes', 'No', 'No',\n","       'Unknown', 'No', 'No', 'Yes', 'No', 'No', 'Yes', 'Yes', 'No', 'No',\n","       'No', 'Unknown', 'Yes', 'Unknown', 'No', 'Unknown', 'No', 'Yes',\n","       'No', 'No', 'Yes', 'No', 'No', 'No', 'No', 'No', 'Yes', 'No',\n","       'Yes', 'Yes', 'Yes', 'Unknown', 'Yes', 'No', 'Yes', 'No', 'Yes',\n","       'No', 'Yes', 'No', 'No', 'No', 'No', 'No', 'No', 'Unknown', 'No',\n","       'No', 'No', 'Yes', 'No', 'No', 'No', 'No', 'Yes', 'Yes', 'No',\n","       'No', 'Yes', 'No', 'No', 'No', 'Yes', 'No', 'Yes', 'No', 'Yes',\n","       'No', 'No', 'No', 'No', 'No', 'No', 'No', 'Yes', 'Yes', 'Yes',\n","       'Yes', 'Unknown', 'Unknown', 'Unknown', 'Unknown', 'Yes', 'No',\n","       'No', 'Yes', 'Yes', 'No', 'No', 'No', 'No', 'Unknown', 'Yes',\n","       'Yes', 'Yes', 'Yes', 'No', 'Unknown', 'No', 'Unknown', 'Unknown',\n","       'Yes', 'Unknown', 'No', 'No', 'Yes', 'No', 'No', 'No', 'Yes', 'No',\n","       'Yes', 'Yes', 'Unknown', 'Unknown', 'Yes', 'No', 'Unknown', 'No',\n","       'No', 'No', 'No', 'Yes', 'No', 'No', 'Yes', 'No', 'Yes', 'No',\n","       'Yes', 'No', 'No', 'Yes', 'No', 'No', 'Yes', 'Yes', 'Unknown',\n","       'No', 'Yes', 'Yes', 'No', 'No', 'No', 'Yes', 'No', 'No', 'Yes',\n","       'Yes', 'No', 'Yes', 'No', 'No', 'No', 'No', 'No', 'Unknown', 'No',\n","       'No', 'Unknown', 'Unknown', 'No', 'Yes', 'No', 'Yes', 'Yes', 'Yes',\n","       'No', 'No', 'No', 'No', 'Yes', 'No', 'Yes', 'No', 'No', 'No', 'No',\n","       'No', 'No', 'No', 'Yes', 'Yes', 'No', 'No', 'No', 'Yes', 'Yes',\n","       'Yes', 'Yes', 'No', 'No', 'No', 'No', 'Yes', 'No', 'Unknown', 'No',\n","       'Unknown', 'No', 'No', 'No', 'No', 'No', 'No', 'Yes', 'Yes', 'No',\n","       'Yes', 'No', 'No', 'No', 'Yes', 'Yes', 'Yes', 'Yes', 'No', 'No',\n","       'No', 'Yes', 'No', 'No', 'Yes', 'Yes', 'No', 'No', 'Yes', 'No',\n","       'No', 'Unknown', 'No', 'No', 'No', 'Unknown', 'Unknown', 'No',\n","       'Unknown', 'Yes', 'No', 'Yes', 'Yes', 'Yes', 'Yes', 'No', 'No',\n","       'No', 'Yes', 'No', 'Unknown', 'Unknown', 'Unknown', 'No', 'No',\n","       'Yes', 'No', 'Unknown', 'No', 'No', 'Yes', 'Yes', 'No', 'No', 'No',\n","       'Yes', 'Yes', 'No', 'No', 'Unknown', 'No', 'No', 'No', 'Yes', 'No',\n","       'Unknown', 'No'], dtype=object)"]},"metadata":{"tags":[]},"execution_count":39}]},{"metadata":{"id":"Y1fgl0T4Fpu7","colab_type":"code","outputId":"e7e90e30-0713-46a5-f6b6-94ed09ac6ed1","executionInfo":{"status":"ok","timestamp":1546005169539,"user_tz":-480,"elapsed":537,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":204}},"cell_type":"code","source":["data.iloc[:,-1] = label #让标签等于我们运行出来的结果\n","data.head()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>Age</th>\n","      <th>Sex</th>\n","      <th>Embarked</th>\n","      <th>Survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>22.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>38.0</td>\n","      <td>female</td>\n","      <td>C</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>26.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>35.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>35.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    Age     Sex Embarked  Survived\n","0  22.0    male        S         0\n","1  38.0  female        C         2\n","2  26.0  female        S         2\n","3  35.0  female        S         2\n","4  35.0    male        S         0"]},"metadata":{"tags":[]},"execution_count":40}]},{"metadata":{"id":"YkMeYWb9FqB4","colab_type":"code","colab":{}},"cell_type":"code","source":["#如果不需要教学展示的话我会这么写：\n","from sklearn.preprocessing import LabelEncoder\n","data.iloc[:,-1] = LabelEncoder().fit_transform(data.iloc[:,-1])"],"execution_count":0,"outputs":[]},{"metadata":{"id":"OBXjKdVqF78s","colab_type":"text"},"cell_type":"markdown","source":["### preprocessing.OrdinalEncoder：特征专用，能够将分类特征转换为分类数值"]},{"metadata":{"id":"-bm9Ei6PF4pN","colab_type":"code","outputId":"f9615d33-49cc-4d73-8c6a-306d6f57a9d7","executionInfo":{"status":"ok","timestamp":1546005260859,"user_tz":-480,"elapsed":680,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":204}},"cell_type":"code","source":["from sklearn.preprocessing import OrdinalEncoder\n","#接口categories_对应LabelEncoder的接口classes_，一模一样的功能\n","data_ = data.copy()\n","data_.head()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>Age</th>\n","      <th>Sex</th>\n","      <th>Embarked</th>\n","      <th>Survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>22.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>38.0</td>\n","      <td>female</td>\n","      <td>C</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>26.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>35.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>35.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    Age     Sex Embarked  Survived\n","0  22.0    male        S         0\n","1  38.0  female        C         2\n","2  26.0  female        S         2\n","3  35.0  female        S         2\n","4  35.0    male        S         0"]},"metadata":{"tags":[]},"execution_count":42}]},{"metadata":{"id":"pl5AbtdnGCcq","colab_type":"code","outputId":"02df7af9-7e20-4c54-efdc-68f380c16c03","executionInfo":{"status":"ok","timestamp":1546005287161,"user_tz":-480,"elapsed":725,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["OrdinalEncoder().fit(data_.iloc[:,1:3]).categories_"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[array(['female', 'male'], dtype=object), array(['C', 'Q', 'S'], dtype=object)]"]},"metadata":{"tags":[]},"execution_count":43}]},{"metadata":{"id":"SHI37GtVGISd","colab_type":"code","outputId":"2c15b468-c39d-4600-cae4-5b20cfc5f122","executionInfo":{"status":"ok","timestamp":1546005290979,"user_tz":-480,"elapsed":683,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":204}},"cell_type":"code","source":["data_.iloc[:,1:-1] = OrdinalEncoder().fit_transform(data_.iloc[:,1:-1])\n","data_.head()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>Age</th>\n","      <th>Sex</th>\n","      <th>Embarked</th>\n","      <th>Survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>22.0</td>\n","      <td>1.0</td>\n","      <td>2.0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>38.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>26.0</td>\n","      <td>0.0</td>\n","      <td>2.0</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>35.0</td>\n","      <td>0.0</td>\n","      <td>2.0</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>35.0</td>\n","      <td>1.0</td>\n","      <td>2.0</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    Age  Sex  Embarked  Survived\n","0  22.0  1.0       2.0         0\n","1  38.0  0.0       0.0         2\n","2  26.0  0.0       2.0         2\n","3  35.0  0.0       2.0         2\n","4  35.0  1.0       2.0         0"]},"metadata":{"tags":[]},"execution_count":44}]},{"metadata":{"id":"edcJVdfWGP_X","colab_type":"text"},"cell_type":"markdown","source":["### preprocessing.OneHotEncoder：独热编码，创建哑变量"]},{"metadata":{"id":"adYz2xURGJyh","colab_type":"code","outputId":"da0af8a0-564c-4f85-d158-1699ce2fb2c9","executionInfo":{"status":"ok","timestamp":1546005349403,"user_tz":-480,"elapsed":849,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":204}},"cell_type":"code","source":["data.head()\n"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>Age</th>\n","      <th>Sex</th>\n","      <th>Embarked</th>\n","      <th>Survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>22.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>38.0</td>\n","      <td>female</td>\n","      <td>C</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>26.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>35.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>2</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>35.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    Age     Sex Embarked  Survived\n","0  22.0    male        S         0\n","1  38.0  female        C         2\n","2  26.0  female        S         2\n","3  35.0  female        S         2\n","4  35.0    male        S         0"]},"metadata":{"tags":[]},"execution_count":45}]},{"metadata":{"id":"7zbyTirjGXWc","colab_type":"code","outputId":"e7e363f1-19f3-4979-c068-1afe765e1a8d","executionInfo":{"status":"ok","timestamp":1546005355848,"user_tz":-480,"elapsed":809,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":136}},"cell_type":"code","source":["from sklearn.preprocessing import OneHotEncoder\n","X = data.iloc[:,1:-1]\n","enc = OneHotEncoder(categories='auto').fit(X)\n","result = enc.transform(X).toarray()\n","result"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[0., 1., 0., 0., 1.],\n","       [1., 0., 1., 0., 0.],\n","       [1., 0., 0., 0., 1.],\n","       ...,\n","       [1., 0., 0., 0., 1.],\n","       [0., 1., 1., 0., 0.],\n","       [0., 1., 0., 1., 0.]])"]},"metadata":{"tags":[]},"execution_count":46}]},{"metadata":{"id":"bG0D0QL6GZmM","colab_type":"code","outputId":"bc8357df-a511-4f8f-d736-81c2f3f710d0","executionInfo":{"status":"ok","timestamp":1546005383798,"user_tz":-480,"elapsed":725,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":136}},"cell_type":"code","source":["#依然可以直接一步到位，但为了给大家展示模型属性，所以还是写成了三步\n","OneHotEncoder(categories='auto').fit_transform(X).toarray()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[0., 1., 0., 0., 1.],\n","       [1., 0., 1., 0., 0.],\n","       [1., 0., 0., 0., 1.],\n","       ...,\n","       [1., 0., 0., 0., 1.],\n","       [0., 1., 1., 0., 0.],\n","       [0., 1., 0., 1., 0.]])"]},"metadata":{"tags":[]},"execution_count":47}]},{"metadata":{"id":"YZ3rtIc2Ggcl","colab_type":"code","outputId":"3bd08140-a727-4fac-be10-77e8d3d2704f","executionInfo":{"status":"ok","timestamp":1546005408763,"user_tz":-480,"elapsed":679,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":1969}},"cell_type":"code","source":["#依然可以还原\n","pd.DataFrame(enc.inverse_transform(result))"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>0</th>\n","      <th>1</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>female</td>\n","      <td>C</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>5</th>\n","      <td>male</td>\n","      <td>Q</td>\n","    </tr>\n","    <tr>\n","      <th>6</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>7</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>8</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>9</th>\n","      <td>female</td>\n","      <td>C</td>\n","    </tr>\n","    <tr>\n","      <th>10</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>11</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>12</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>13</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>14</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>15</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>16</th>\n","      <td>male</td>\n","      <td>Q</td>\n","    </tr>\n","    <tr>\n","      <th>17</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>18</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>19</th>\n","      <td>female</td>\n","      <td>C</td>\n","    </tr>\n","    <tr>\n","      <th>20</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>21</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>22</th>\n","      <td>female</td>\n","      <td>Q</td>\n","    </tr>\n","    <tr>\n","      <th>23</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>24</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>25</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>26</th>\n","      <td>male</td>\n","      <td>C</td>\n","    </tr>\n","    <tr>\n","      <th>27</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>28</th>\n","      <td>female</td>\n","      <td>Q</td>\n","    </tr>\n","    <tr>\n","      <th>29</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>...</th>\n","      <td>...</td>\n","      <td>...</td>\n","    </tr>\n","    <tr>\n","      <th>859</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>860</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>861</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>862</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>863</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>864</th>\n","      <td>female</td>\n","      <td>C</td>\n","    </tr>\n","    <tr>\n","      <th>865</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>866</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>867</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>868</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>869</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>870</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>871</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>872</th>\n","      <td>female</td>\n","      <td>C</td>\n","    </tr>\n","    <tr>\n","      <th>873</th>\n","      <td>female</td>\n","      <td>C</td>\n","    </tr>\n","    <tr>\n","      <th>874</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>875</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>876</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>877</th>\n","      <td>female</td>\n","      <td>C</td>\n","    </tr>\n","    <tr>\n","      <th>878</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>879</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>880</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>881</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>882</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>883</th>\n","      <td>female</td>\n","      <td>Q</td>\n","    </tr>\n","    <tr>\n","      <th>884</th>\n","      <td>male</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>885</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>886</th>\n","      <td>female</td>\n","      <td>S</td>\n","    </tr>\n","    <tr>\n","      <th>887</th>\n","      <td>male</td>\n","      <td>C</td>\n","    </tr>\n","    <tr>\n","      <th>888</th>\n","      <td>male</td>\n","      <td>Q</td>\n","    </tr>\n","  </tbody>\n","</table>\n","<p>889 rows × 2 columns</p>\n","</div>"],"text/plain":["          0  1\n","0      male  S\n","1    female  C\n","2    female  S\n","3    female  S\n","4      male  S\n","5      male  Q\n","6      male  S\n","7      male  S\n","8    female  S\n","9    female  C\n","10   female  S\n","11   female  S\n","12     male  S\n","13     male  S\n","14   female  S\n","15   female  S\n","16     male  Q\n","17     male  S\n","18   female  S\n","19   female  C\n","20     male  S\n","21     male  S\n","22   female  Q\n","23     male  S\n","24   female  S\n","25   female  S\n","26     male  C\n","27     male  S\n","28   female  Q\n","29     male  S\n","..      ... ..\n","859    male  S\n","860  female  S\n","861  female  S\n","862    male  S\n","863  female  S\n","864  female  C\n","865    male  S\n","866    male  S\n","867    male  S\n","868    male  S\n","869  female  S\n","870    male  S\n","871    male  S\n","872  female  C\n","873  female  C\n","874    male  S\n","875    male  S\n","876    male  S\n","877  female  C\n","878  female  S\n","879    male  S\n","880  female  S\n","881    male  S\n","882    male  S\n","883  female  Q\n","884    male  S\n","885  female  S\n","886  female  S\n","887    male  C\n","888    male  Q\n","\n","[889 rows x 2 columns]"]},"metadata":{"tags":[]},"execution_count":48}]},{"metadata":{"id":"d-M0Q9ExGmjc","colab_type":"code","outputId":"be947ed4-c39c-40a9-dd26-8a85d4e43643","executionInfo":{"status":"ok","timestamp":1546005425045,"user_tz":-480,"elapsed":707,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["enc.get_feature_names()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array(['x0_female', 'x0_male', 'x1_C', 'x1_Q', 'x1_S'], dtype=object)"]},"metadata":{"tags":[]},"execution_count":49}]},{"metadata":{"id":"osG0QiLBGqhk","colab_type":"code","outputId":"233e89f4-27bf-4b60-8c0b-3765adbeaf55","executionInfo":{"status":"ok","timestamp":1546005445010,"user_tz":-480,"elapsed":753,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":136}},"cell_type":"code","source":["result\n"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[0., 1., 0., 0., 1.],\n","       [1., 0., 1., 0., 0.],\n","       [1., 0., 0., 0., 1.],\n","       ...,\n","       [1., 0., 0., 0., 1.],\n","       [0., 1., 1., 0., 0.],\n","       [0., 1., 0., 1., 0.]])"]},"metadata":{"tags":[]},"execution_count":50}]},{"metadata":{"id":"3vLbdXHoGu9b","colab_type":"code","outputId":"abddab42-d8e6-4a9d-ab0e-6e36fb7281f3","executionInfo":{"status":"ok","timestamp":1546005450046,"user_tz":-480,"elapsed":685,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["result.shape"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(889, 5)"]},"metadata":{"tags":[]},"execution_count":51}]},{"metadata":{"id":"N81TclZyGwoS","colab_type":"code","outputId":"21697836-72a2-4d70-9fe9-49a8b8ec7d8a","executionInfo":{"status":"ok","timestamp":1546005462422,"user_tz":-480,"elapsed":663,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":204}},"cell_type":"code","source":["#axis=1,表示跨行进行合并，也就是将量表左右相连，如果是axis=0，就是将量表上下相连\n","newdata = pd.concat([data,pd.DataFrame(result)],axis=1)\n","newdata.head()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>Age</th>\n","      <th>Sex</th>\n","      <th>Embarked</th>\n","      <th>Survived</th>\n","      <th>0</th>\n","      <th>1</th>\n","      <th>2</th>\n","      <th>3</th>\n","      <th>4</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>22.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>38.0</td>\n","      <td>female</td>\n","      <td>C</td>\n","      <td>2.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>26.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>2.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>35.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>2.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>35.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    Age     Sex Embarked  Survived    0    1    2    3    4\n","0  22.0    male        S       0.0  0.0  1.0  0.0  0.0  1.0\n","1  38.0  female        C       2.0  1.0  0.0  1.0  0.0  0.0\n","2  26.0  female        S       2.0  1.0  0.0  0.0  0.0  1.0\n","3  35.0  female        S       2.0  1.0  0.0  0.0  0.0  1.0\n","4  35.0    male        S       0.0  0.0  1.0  0.0  0.0  1.0"]},"metadata":{"tags":[]},"execution_count":52}]},{"metadata":{"id":"f94u-XTtGzp6","colab_type":"code","outputId":"b62f2f70-3f5f-40c5-b235-8728b35b7779","executionInfo":{"status":"ok","timestamp":1546005487466,"user_tz":-480,"elapsed":694,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":204}},"cell_type":"code","source":["newdata.drop([\"Sex\",\"Embarked\"],axis=1,inplace=True)\n","newdata.columns =[\"Age\",\"Survived\",\"Female\",\"Male\",\"Embarked_C\",\"Embarked_Q\",\"Embarked_S\"]\n","newdata.head()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>Age</th>\n","      <th>Survived</th>\n","      <th>Female</th>\n","      <th>Male</th>\n","      <th>Embarked_C</th>\n","      <th>Embarked_Q</th>\n","      <th>Embarked_S</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>22.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>38.0</td>\n","      <td>2.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>26.0</td>\n","      <td>2.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>35.0</td>\n","      <td>2.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>35.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    Age  Survived  Female  Male  Embarked_C  Embarked_Q  Embarked_S\n","0  22.0       0.0     0.0   1.0         0.0         0.0         1.0\n","1  38.0       2.0     1.0   0.0         1.0         0.0         0.0\n","2  26.0       2.0     1.0   0.0         0.0         0.0         1.0\n","3  35.0       2.0     1.0   0.0         0.0         0.0         1.0\n","4  35.0       0.0     0.0   1.0         0.0         0.0         1.0"]},"metadata":{"tags":[]},"execution_count":53}]},{"metadata":{"id":"RdTBnAUrHA9y","colab_type":"text"},"cell_type":"markdown","source":["##  4处理连续型特征：二值化与分段"]},{"metadata":{"id":"DT16N5IYHFm2","colab_type":"text"},"cell_type":"markdown","source":["### sklearn.preprocessing.Binarizer"]},{"metadata":{"id":"_hSu5qjZG5wp","colab_type":"code","outputId":"a00b877b-6e82-4efa-8c64-3487e582a9ce","executionInfo":{"status":"ok","timestamp":1546005556325,"user_tz":-480,"elapsed":635,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":15130}},"cell_type":"code","source":["#将年龄二值化\n","data_2 = data.copy()\n","from sklearn.preprocessing import Binarizer\n","X = data_2.iloc[:,0].values.reshape(-1,1) #类为特征专用，所以不能使用一维数组\n","transformer = Binarizer(threshold=30).fit_transform(X)\n","transformer"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.]])"]},"metadata":{"tags":[]},"execution_count":54}]},{"metadata":{"id":"EXWAxDJpHQAc","colab_type":"text"},"cell_type":"markdown","source":["### preprocessing.KBinsDiscretizer"]},{"metadata":{"id":"0M8qZ1Ce72o_","colab_type":"code","outputId":"db672dd4-29b6-400a-893c-85c4c3b6891f","executionInfo":{"status":"ok","timestamp":1546069761101,"user_tz":-480,"elapsed":914,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":204}},"cell_type":"code","source":["import pandas as pd\n","data = pd.read_csv(\"./Narrativedata.csv\"\n","                   ,index_col=0\n","                  )\n","data.head()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>Age</th>\n","      <th>Sex</th>\n","      <th>Embarked</th>\n","      <th>Survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>22.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>No</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>38.0</td>\n","      <td>female</td>\n","      <td>C</td>\n","      <td>Yes</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>26.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>Yes</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>35.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>Yes</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>35.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>No</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    Age     Sex Embarked Survived\n","0  22.0    male        S       No\n","1  38.0  female        C      Yes\n","2  26.0  female        S      Yes\n","3  35.0  female        S      Yes\n","4  35.0    male        S       No"]},"metadata":{"tags":[]},"execution_count":3}]},{"metadata":{"id":"h8SbvQsv8V8g","colab_type":"code","colab":{}},"cell_type":"code","source":["data.loc[:,\"Age\"] = data.loc[:,\"Age\"].fillna(data.loc[:,\"Age\"].median())\n","#.fillna 在DataFrame里面直接进行填补\n","data.dropna(axis=0,inplace=True)"],"execution_count":0,"outputs":[]},{"metadata":{"id":"eJyfDeqJHKlU","colab_type":"code","outputId":"5393b31a-b9cc-444e-ce5b-d6683bfda84b","executionInfo":{"status":"ok","timestamp":1546069833351,"user_tz":-480,"elapsed":755,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":15130}},"cell_type":"code","source":["from sklearn.preprocessing import KBinsDiscretizer\n","X = data.iloc[:,0].values.reshape(-1,1)\n","est = KBinsDiscretizer(n_bins=3, encode='ordinal', strategy='uniform')\n","est.fit_transform(X)"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [2.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [2.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [2.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [2.],\n","       [2.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [2.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [2.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [2.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [2.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [2.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [0.],\n","       [0.],\n","       [1.],\n","       [2.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [1.],\n","       [0.],\n","       [1.],\n","       [0.],\n","       [1.]])"]},"metadata":{"tags":[]},"execution_count":6}]},{"metadata":{"id":"gFCIKwjjHYcl","colab_type":"code","outputId":"794b0300-ab85-40b7-c3ed-e72aea6fc695","executionInfo":{"status":"ok","timestamp":1546069848310,"user_tz":-480,"elapsed":690,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["#查看转换后分的箱：变成了一列中的三箱\n","set(est.fit_transform(X).ravel())\n"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["{0.0, 1.0, 2.0}"]},"metadata":{"tags":[]},"execution_count":7}]},{"metadata":{"id":"N_NHr0GKHcN9","colab_type":"code","colab":{}},"cell_type":"code","source":["est1 = KBinsDiscretizer(n_bins=3, encode='onehot', strategy='uniform')\n","#查看转换后分的箱：变成了哑变量\n","re1 = est1.fit_transform(X).toarray()"],"execution_count":0,"outputs":[]},{"metadata":{"id":"KppSnNFm_J2k","colab_type":"code","outputId":"22f88879-b988-4b0c-d4fc-4fc704c53e09","executionInfo":{"status":"ok","timestamp":1546070606252,"user_tz":-480,"elapsed":715,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":51}},"cell_type":"code","source":["est1.bin_edges_\n","# 每个箱子的边缘"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([array([ 0.42      , 26.94666667, 53.47333333, 80.        ])],\n","      dtype=object)"]},"metadata":{"tags":[]},"execution_count":16}]},{"metadata":{"id":"C9oyWxzN_c5Q","colab_type":"code","outputId":"9b50a432-3012-4073-ec2b-29a95ee268b6","executionInfo":{"status":"ok","timestamp":1546070681290,"user_tz":-480,"elapsed":744,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["data.loc[:,\"Age\"].min()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0.42"]},"metadata":{"tags":[]},"execution_count":17}]},{"metadata":{"id":"4FOUIiO7_nt_","colab_type":"code","outputId":"162eca69-675d-43c9-a213-4f4769698650","executionInfo":{"status":"ok","timestamp":1546070692997,"user_tz":-480,"elapsed":755,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["data.loc[:,\"Age\"].max()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["80.0"]},"metadata":{"tags":[]},"execution_count":18}]},{"metadata":{"id":"C5w8_1-1-vXw","colab_type":"code","outputId":"b72b01ee-727d-48b0-ea09-030db941ff5f","executionInfo":{"status":"ok","timestamp":1546070478519,"user_tz":-480,"elapsed":712,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":204}},"cell_type":"code","source":["newdata = pd.concat([data,pd.DataFrame(re1)],axis=1)\n","newdata.head()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>Age</th>\n","      <th>Sex</th>\n","      <th>Embarked</th>\n","      <th>Survived</th>\n","      <th>0</th>\n","      <th>1</th>\n","      <th>2</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>22.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>No</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>38.0</td>\n","      <td>female</td>\n","      <td>C</td>\n","      <td>Yes</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>26.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>Yes</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","      <td>0.0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>35.0</td>\n","      <td>female</td>\n","      <td>S</td>\n","      <td>Yes</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>35.0</td>\n","      <td>male</td>\n","      <td>S</td>\n","      <td>No</td>\n","      <td>0.0</td>\n","      <td>1.0</td>\n","      <td>0.0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    Age     Sex Embarked Survived    0    1    2\n","0  22.0    male        S       No  1.0  0.0  0.0\n","1  38.0  female        C      Yes  0.0  1.0  0.0\n","2  26.0  female        S      Yes  1.0  0.0  0.0\n","3  35.0  female        S      Yes  0.0  1.0  0.0\n","4  35.0    male        S       No  0.0  1.0  0.0"]},"metadata":{"tags":[]},"execution_count":14}]},{"metadata":{"id":"-_21fV8o8dvj","colab_type":"code","outputId":"4957bde5-cb7f-4dbc-ef0c-23c7f4c8a284","executionInfo":{"status":"ok","timestamp":1546070094737,"user_tz":-480,"elapsed":766,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":136}},"cell_type":"code","source":["est2 = KBinsDiscretizer(n_bins=3, encode='onehot-dense', strategy='uniform')\n","est2.fit_transform(X)"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([[1., 0., 0.],\n","       [0., 1., 0.],\n","       [1., 0., 0.],\n","       ...,\n","       [0., 1., 0.],\n","       [1., 0., 0.],\n","       [0., 1., 0.]])"]},"metadata":{"tags":[]},"execution_count":12}]},{"metadata":{"id":"qNZ05MuUHouO","colab_type":"text"},"cell_type":"markdown","source":["# 特征选择 feature_selection"]},{"metadata":{"id":"_0Jzv_9CBCwm","colab_type":"text"},"cell_type":"markdown","source":["### var"]},{"metadata":{"id":"YdoTrncFBFDT","colab_type":"text"},"cell_type":"markdown","source":["numpy与pandas中的var使用方法不同一样\n","numpy中，var的axis默认为None，是对所有数据进行求var\n","\n","dataframe的var的axis默认为0，是对每一列数据进行求var\n","所以datasam.var(axis=0)==datasam.var()"]},{"metadata":{"id":"IUBxN8rW-wnQ","colab_type":"code","colab":{}},"cell_type":"code","source":["import numpy as np\n","import pandas as pd\n","datasam = pd.read_csv(r\"./sample_data/mnist_train_small.csv\",header=None)"],"execution_count":0,"outputs":[]},{"metadata":{"id":"Hszm0Rag_DJr","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":233},"outputId":"05033a7c-5ee1-4573-82c8-39585cee0b7b","executionInfo":{"status":"ok","timestamp":1551322512936,"user_tz":-480,"elapsed":615,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["datasam.head()"],"execution_count":50,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>0</th>\n","      <th>1</th>\n","      <th>2</th>\n","      <th>3</th>\n","      <th>4</th>\n","      <th>5</th>\n","      <th>6</th>\n","      <th>7</th>\n","      <th>8</th>\n","      <th>9</th>\n","      <th>...</th>\n","      <th>775</th>\n","      <th>776</th>\n","      <th>777</th>\n","      <th>778</th>\n","      <th>779</th>\n","      <th>780</th>\n","      <th>781</th>\n","      <th>782</th>\n","      <th>783</th>\n","      <th>784</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>6</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>5</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>7</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>9</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>5</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","<p>5 rows × 785 columns</p>\n","</div>"],"text/plain":["   0    1    2    3    4    5    6    7    8    9   ...   775  776  777  778  \\\n","0    6    0    0    0    0    0    0    0    0    0 ...     0    0    0    0   \n","1    5    0    0    0    0    0    0    0    0    0 ...     0    0    0    0   \n","2    7    0    0    0    0    0    0    0    0    0 ...     0    0    0    0   \n","3    9    0    0    0    0    0    0    0    0    0 ...     0    0    0    0   \n","4    5    0    0    0    0    0    0    0    0    0 ...     0    0    0    0   \n","\n","   779  780  781  782  783  784  \n","0    0    0    0    0    0    0  \n","1    0    0    0    0    0    0  \n","2    0    0    0    0    0    0  \n","3    0    0    0    0    0    0  \n","4    0    0    0    0    0    0  \n","\n","[5 rows x 785 columns]"]},"metadata":{"tags":[]},"execution_count":50}]},{"metadata":{"id":"6gFCSztGBzd_","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":102},"outputId":"c6de7d6f-fec0-4668-baac-aaae1a54de40","executionInfo":{"status":"ok","timestamp":1551322537360,"user_tz":-480,"elapsed":717,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}}},"cell_type":"code","source":["datasam.info()"],"execution_count":51,"outputs":[{"output_type":"stream","text":["<class 'pandas.core.frame.DataFrame'>\n","RangeIndex: 20000 entries, 0 to 19999\n","Columns: 785 entries, 0 to 784\n","dtypes: int64(785)\n","memory usage: 119.8 MB\n"],"name":"stdout"}]},{"metadata":{"id":"2ZY_WF40_Qdp","colab_type":"code","colab":{}},"cell_type":"code","source":["datasam.var()"],"execution_count":0,"outputs":[]},{"metadata":{"id":"aXXKrg-B_278","colab_type":"code","colab":{}},"cell_type":"code","source":["datasam.var(axis=0)-datasam.var()"],"execution_count":0,"outputs":[]},{"metadata":{"id":"tpsZ5azSHftY","colab_type":"code","outputId":"47e44ea4-a8f1-4db1-e773-75540496dd21","executionInfo":{"status":"ok","timestamp":1546076932673,"user_tz":-480,"elapsed":5924,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":253}},"cell_type":"code","source":["#导入数据，让我们使用digit recognizor数据来一展身手\n","import pandas as pd\n","import numpy as np\n","data = pd.read_csv(r\"digit recognizor.csv\")\n","data.head()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>label</th>\n","      <th>pixel0</th>\n","      <th>pixel1</th>\n","      <th>pixel2</th>\n","      <th>pixel3</th>\n","      <th>pixel4</th>\n","      <th>pixel5</th>\n","      <th>pixel6</th>\n","      <th>pixel7</th>\n","      <th>pixel8</th>\n","      <th>...</th>\n","      <th>pixel774</th>\n","      <th>pixel775</th>\n","      <th>pixel776</th>\n","      <th>pixel777</th>\n","      <th>pixel778</th>\n","      <th>pixel779</th>\n","      <th>pixel780</th>\n","      <th>pixel781</th>\n","      <th>pixel782</th>\n","      <th>pixel783</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>4</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","<p>5 rows × 785 columns</p>\n","</div>"],"text/plain":["   label  pixel0  pixel1  pixel2  pixel3  pixel4  pixel5  pixel6  pixel7  \\\n","0      1       0       0       0       0       0       0       0       0   \n","1      0       0       0       0       0       0       0       0       0   \n","2      1       0       0       0       0       0       0       0       0   \n","3      4       0       0       0       0       0       0       0       0   \n","4      0       0       0       0       0       0       0       0       0   \n","\n","   pixel8    ...     pixel774  pixel775  pixel776  pixel777  pixel778  \\\n","0       0    ...            0         0         0         0         0   \n","1       0    ...            0         0         0         0         0   \n","2       0    ...            0         0         0         0         0   \n","3       0    ...            0         0         0         0         0   \n","4       0    ...            0         0         0         0         0   \n","\n","   pixel779  pixel780  pixel781  pixel782  pixel783  \n","0         0         0         0         0         0  \n","1         0         0         0         0         0  \n","2         0         0         0         0         0  \n","3         0         0         0         0         0  \n","4         0         0         0         0         0  \n","\n","[5 rows x 785 columns]"]},"metadata":{"tags":[]},"execution_count":1}]},{"metadata":{"id":"i57WdtgaXYKt","colab_type":"code","outputId":"6e4fcd24-0e23-4b16-9840-0969f0c65538","executionInfo":{"status":"ok","timestamp":1546076943398,"user_tz":-480,"elapsed":631,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["X = data.iloc[:,1:]\n","y = data.iloc[:,0]\n","X.shape\n","\n","\n","# \"\"\"\n","# 这个数据量相对夸张，如果使用支持向量机和神经网络，很可能会直接跑不出来。使用KNN跑一次大概需要半个小时。\n","# 用这个数据举例，能更够体现特征工程的重要性。\n","# \"\"\""],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(42000, 784)"]},"metadata":{"tags":[]},"execution_count":2}]},{"metadata":{"id":"V5OPjyNZIDgW","colab_type":"text"},"cell_type":"markdown","source":["## 1 Filter过滤法"]},{"metadata":{"id":"wo9mJms0IIYs","colab_type":"text"},"cell_type":"markdown","source":["### VarianceThreshold"]},{"metadata":{"id":"fWIzcQU8H0A2","colab_type":"code","outputId":"30a386d5-893d-4625-e6d5-e077cd79d68e","executionInfo":{"status":"ok","timestamp":1546076949224,"user_tz":-480,"elapsed":2124,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["from sklearn.feature_selection import VarianceThreshold\n","selector = VarianceThreshold() #实例化，不填参数默认方差为0\n","X_var0 = selector.fit_transform(X) #获取删除不合格特征之后的新特征矩阵\n","#也可以直接写成 X = VairanceThreshold().fit_transform(X)\n","X_var0.shape"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(42000, 708)"]},"metadata":{"tags":[]},"execution_count":3}]},{"metadata":{"id":"RsMAOx_EIUvy","colab_type":"code","outputId":"3845a15c-7f84-43a1-dcd4-48cf5600f106","executionInfo":{"status":"ok","timestamp":1546076952718,"user_tz":-480,"elapsed":1996,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":3349}},"cell_type":"code","source":["X.var().values"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n","       3.22760590e-01, 2.64689018e+00, 1.11085714e+00, 1.92857143e-03,\n","       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n","       6.09523810e-03, 5.41186213e-02, 1.28065733e+00, 5.33793150e+00,\n","       9.74592647e+00, 1.06219147e+01, 2.49289953e+01, 3.37671294e+01,\n","       3.59425660e+01, 3.49309575e+01, 3.62943342e+01, 3.27911079e+01,\n","       3.04237672e+01, 2.95547817e+01, 2.00568398e+01, 1.19545659e+01,\n","       8.60419724e+00, 2.55465685e+00, 1.60530842e+00, 9.29377602e-01,\n","       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 9.75238095e-02, 2.00238095e-02,\n","       8.38442376e-01, 6.23481035e-01, 9.48446647e+00, 2.93530906e+01,\n","       5.67872968e+01, 1.00230634e+02, 1.65873698e+02, 2.52738939e+02,\n","       3.76018084e+02, 5.14426094e+02, 6.50102357e+02, 7.26608631e+02,\n","       7.20549617e+02, 6.49594181e+02, 5.18814455e+02, 3.94092376e+02,\n","       2.35038093e+02, 1.14843923e+02, 5.61521180e+01, 1.70331842e+01,\n","       6.48083740e+00, 1.08821717e+00, 0.00000000e+00, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 4.76236337e-01, 2.75489198e-01,\n","       1.29297595e+00, 1.26446724e+01, 4.28153306e+01, 9.43924926e+01,\n","       2.15866693e+02, 4.40079141e+02, 7.26679321e+02, 1.10776068e+03,\n","       1.49073923e+03, 1.93993499e+03, 2.31552090e+03, 2.59022407e+03,\n","       2.49637882e+03, 2.22627799e+03, 1.80800104e+03, 1.31417708e+03,\n","       7.95887557e+02, 4.41320506e+02, 1.99165391e+02, 7.95865424e+01,\n","       3.10264989e+01, 2.26837146e+00, 3.48595238e-01, 0.00000000e+00,\n","       0.00000000e+00, 3.43809524e-02, 1.15447633e-01, 1.25289059e+00,\n","       1.15530325e+01, 6.16749834e+01, 1.71059884e+02, 4.37266473e+02,\n","       9.14503323e+02, 1.61733281e+03, 2.58238559e+03, 3.73319320e+03,\n","       4.97101576e+03, 6.18285701e+03, 7.12176198e+03, 7.61902605e+03,\n","       7.35140128e+03, 6.59732933e+03, 5.42159265e+03, 4.14622275e+03,\n","       2.74210919e+03, 1.60716526e+03, 8.30092375e+02, 3.85524893e+02,\n","       1.44471061e+02, 2.98361218e+01, 5.45472846e+00, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 7.16499590e-01, 5.19710545e+00,\n","       6.12264995e+01, 2.53650903e+02, 6.51218510e+02, 1.32512948e+03,\n","       2.39625599e+03, 3.90432573e+03, 5.65248822e+03, 7.50750831e+03,\n","       9.28013155e+03, 1.07098605e+04, 1.15505424e+04, 1.18353399e+04,\n","       1.16728383e+04, 1.10553420e+04, 9.77051209e+03, 8.00603359e+03,\n","       5.90601149e+03, 3.83759619e+03, 2.22900745e+03, 1.15756773e+03,\n","       5.07963705e+02, 1.22007799e+02, 1.78286793e+01, 7.71428571e-03,\n","       0.00000000e+00, 3.80952381e-04, 2.37199928e+00, 3.95713081e+01,\n","       2.07427935e+02, 6.06480056e+02, 1.37944393e+03, 2.64652318e+03,\n","       4.39063213e+03, 6.55335113e+03, 8.64850053e+03, 1.03924767e+04,\n","       1.16602029e+04, 1.23720092e+04, 1.25944602e+04, 1.26223718e+04,\n","       1.26261428e+04, 1.25617677e+04, 1.20570623e+04, 1.07029270e+04,\n","       8.66359114e+03, 6.04366459e+03, 3.77715738e+03, 2.05026195e+03,\n","       9.47173606e+02, 3.04430342e+02, 5.49548377e+01, 3.50648111e+00,\n","       0.00000000e+00, 1.47595606e+00, 1.73365714e+01, 1.03708159e+02,\n","       4.49220215e+02, 1.11598051e+03, 2.31261700e+03, 4.05981199e+03,\n","       6.27112094e+03, 8.61258120e+03, 1.04088978e+04, 1.15863594e+04,\n","       1.20861191e+04, 1.22313676e+04, 1.22256615e+04, 1.21230025e+04,\n","       1.21304108e+04, 1.22345097e+04, 1.22810693e+04, 1.17587829e+04,\n","       1.01382911e+04, 7.63237251e+03, 4.91736987e+03, 2.72324144e+03,\n","       1.22087326e+03, 4.16952121e+02, 7.84619988e+01, 2.69471891e+00,\n","       6.68809524e-02, 1.14742637e+01, 7.06094700e+01, 2.58579123e+02,\n","       7.58812237e+02, 1.66236697e+03, 3.16372296e+03, 5.28061009e+03,\n","       7.80859675e+03, 1.00912727e+04, 1.16171690e+04, 1.22797788e+04,\n","       1.23833077e+04, 1.24581779e+04, 1.23866060e+04, 1.23021558e+04,\n","       1.22796752e+04, 1.23185424e+04, 1.24370140e+04, 1.21441547e+04,\n","       1.08800641e+04, 8.45510124e+03, 5.53590659e+03, 2.92299426e+03,\n","       1.27293575e+03, 4.39632397e+02, 7.77464211e+01, 2.35152706e+00,\n","       1.41387108e+00, 1.83873300e+01, 1.01219976e+02, 3.59094119e+02,\n","       9.16376867e+02, 1.90547923e+03, 3.64144404e+03, 6.06890402e+03,\n","       8.86696591e+03, 1.10299773e+04, 1.21997003e+04, 1.24677668e+04,\n","       1.23878202e+04, 1.20816759e+04, 1.18414911e+04, 1.18243379e+04,\n","       1.19196049e+04, 1.22058487e+04, 1.24040782e+04, 1.21013351e+04,\n","       1.08905421e+04, 8.53288188e+03, 5.50599673e+03, 2.77180472e+03,\n","       1.06085951e+03, 3.12689774e+02, 5.19949129e+01, 5.02228364e+00,\n","       3.12121001e+00, 1.92336286e+01, 1.00196288e+02, 3.33760276e+02,\n","       8.42723536e+02, 1.87713749e+03, 3.80614513e+03, 6.46513903e+03,\n","       9.41022768e+03, 1.14543460e+04, 1.22494028e+04, 1.22551059e+04,\n","       1.15972630e+04, 1.07756156e+04, 1.05723907e+04, 1.10540147e+04,\n","       1.14904415e+04, 1.20641837e+04, 1.22340857e+04, 1.19219747e+04,\n","       1.04672465e+04, 8.02282693e+03, 5.11996418e+03, 2.49340573e+03,\n","       8.29185839e+02, 2.02728469e+02, 3.65252982e+01, 4.73545802e+00,\n","       6.54689762e-01, 1.10762921e+01, 8.21810900e+01, 2.45993138e+02,\n","       6.88037918e+02, 1.77097595e+03, 3.89510214e+03, 6.82414020e+03,\n","       9.88524752e+03, 1.16866740e+04, 1.22052249e+04, 1.18503310e+04,\n","       1.08057141e+04, 1.00029368e+04, 1.05613005e+04, 1.13459087e+04,\n","       1.16813954e+04, 1.21153444e+04, 1.22013911e+04, 1.16257849e+04,\n","       9.77524122e+03, 7.24039730e+03, 4.72965127e+03, 2.39611574e+03,\n","       7.37971166e+02, 1.05994299e+02, 2.09059137e+01, 7.86044778e-01,\n","       6.32595238e-01, 6.32770971e+00, 4.96597411e+01, 1.73335928e+02,\n","       5.64355135e+02, 1.79246896e+03, 4.19852946e+03, 7.42330328e+03,\n","       1.03680620e+04, 1.19241275e+04, 1.22167302e+04, 1.17312041e+04,\n","       1.08331969e+04, 1.06956425e+04, 1.18765965e+04, 1.23125550e+04,\n","       1.21036991e+04, 1.23648277e+04, 1.23532159e+04, 1.12659827e+04,\n","       9.01309194e+03, 6.65304923e+03, 4.53230600e+03, 2.53236771e+03,\n","       8.13317532e+02, 7.57360821e+01, 1.22663918e+01, 9.49856083e-01,\n","       2.43809524e-02, 2.05312854e+00, 2.37737153e+01, 1.15295050e+02,\n","       5.23151198e+02, 2.00356402e+03, 4.71208413e+03, 8.02210576e+03,\n","       1.07142826e+04, 1.19844734e+04, 1.21443066e+04, 1.17352672e+04,\n","       1.13501890e+04, 1.18058310e+04, 1.29305253e+04, 1.24664835e+04,\n","       1.21090771e+04, 1.25723716e+04, 1.24760936e+04, 1.09595385e+04,\n","       8.66572810e+03, 6.56048630e+03, 4.59945505e+03, 2.74090145e+03,\n","       9.79975029e+02, 1.02467830e+02, 1.16955902e+01, 2.92035599e+00,\n","       0.00000000e+00, 8.53042930e-01, 8.80331299e+00, 7.52414185e+01,\n","       5.33884018e+02, 2.30333924e+03, 5.22384299e+03, 8.41596660e+03,\n","       1.08537671e+04, 1.19270178e+04, 1.19856397e+04, 1.17039418e+04,\n","       1.16715555e+04, 1.24445986e+04, 1.29618550e+04, 1.20230391e+04,\n","       1.20377425e+04, 1.26434659e+04, 1.24012680e+04, 1.08759560e+04,\n","       8.87523588e+03, 6.85569402e+03, 4.84378377e+03, 2.91796192e+03,\n","       1.10844668e+03, 1.39672375e+02, 8.86639995e+00, 7.94981734e-02,\n","       0.00000000e+00, 0.00000000e+00, 4.63950502e+00, 8.33393904e+01,\n","       6.29744755e+02, 2.69185746e+03, 5.62185375e+03, 8.53435292e+03,\n","       1.06354679e+04, 1.16397177e+04, 1.17410232e+04, 1.17248709e+04,\n","       1.20446633e+04, 1.27114555e+04, 1.27125078e+04, 1.20008852e+04,\n","       1.24098689e+04, 1.26745406e+04, 1.20741286e+04, 1.08898533e+04,\n","       9.21323231e+03, 7.22598679e+03, 5.04689745e+03, 2.90913735e+03,\n","       1.12277645e+03, 1.91078386e+02, 2.57469149e+01, 1.29179123e+00,\n","       0.00000000e+00, 7.69744852e-02, 1.03197870e+01, 1.11053766e+02,\n","       8.11564748e+02, 3.07386387e+03, 5.91065656e+03, 8.36008213e+03,\n","       1.01408287e+04, 1.10632136e+04, 1.12910607e+04, 1.14976813e+04,\n","       1.20735231e+04, 1.27502876e+04, 1.26987222e+04, 1.23901805e+04,\n","       1.26170244e+04, 1.23916950e+04, 1.17483338e+04, 1.09217037e+04,\n","       9.48760960e+03, 7.35171522e+03, 5.01095743e+03, 2.72992609e+03,\n","       1.04916705e+03, 2.25941630e+02, 3.05993271e+01, 2.87316363e+00,\n","       0.00000000e+00, 2.28039253e-01, 1.74352649e+01, 1.69998742e+02,\n","       1.10767541e+03, 3.43926495e+03, 6.05208363e+03, 8.08344097e+03,\n","       9.50906305e+03, 1.03073030e+04, 1.06715518e+04, 1.10973680e+04,\n","       1.17642567e+04, 1.22940460e+04, 1.25222837e+04, 1.24838281e+04,\n","       1.23538616e+04, 1.20985659e+04, 1.17177753e+04, 1.10570877e+04,\n","       9.47381642e+03, 7.19094489e+03, 4.63491474e+03, 2.42432309e+03,\n","       9.17534777e+02, 2.34119338e+02, 3.27687618e+01, 1.59861539e+00,\n","       1.47639388e-01, 4.47934602e-01, 2.76028871e+01, 2.71942488e+02,\n","       1.45371251e+03, 3.83133451e+03, 6.28631187e+03, 8.14612790e+03,\n","       9.30917203e+03, 1.00179199e+04, 1.05639229e+04, 1.09925571e+04,\n","       1.13187529e+04, 1.19116163e+04, 1.23480093e+04, 1.23440430e+04,\n","       1.21692394e+04, 1.21290528e+04, 1.19460348e+04, 1.11011974e+04,\n","       9.19667530e+03, 6.71976236e+03, 4.18683656e+03, 2.12415117e+03,\n","       8.18965786e+02, 2.22857925e+02, 2.54140760e+01, 1.36995713e+00,\n","       0.00000000e+00, 1.81578450e+00, 4.96345920e+01, 3.80903626e+02,\n","       1.68403918e+03, 4.10905800e+03, 6.66129020e+03, 8.56235623e+03,\n","       9.76878976e+03, 1.05714566e+04, 1.11195093e+04, 1.14535438e+04,\n","       1.17907581e+04, 1.21204054e+04, 1.24479360e+04, 1.23900112e+04,\n","       1.22489975e+04, 1.23606302e+04, 1.19785927e+04, 1.06491638e+04,\n","       8.49640625e+03, 5.95805507e+03, 3.53263357e+03, 1.70287256e+03,\n","       6.43673157e+02, 1.79133677e+02, 2.84028991e+01, 6.28175963e-01,\n","       0.00000000e+00, 1.23625493e+00, 5.65580767e+01, 4.36617659e+02,\n","       1.67611596e+03, 3.91825583e+03, 6.61848502e+03, 8.93197399e+03,\n","       1.05084494e+04, 1.14328933e+04, 1.19110401e+04, 1.21686631e+04,\n","       1.23576844e+04, 1.24269771e+04, 1.24145723e+04, 1.24011494e+04,\n","       1.23905027e+04, 1.22793811e+04, 1.14389559e+04, 9.61909799e+03,\n","       7.11272858e+03, 4.61189510e+03, 2.55069845e+03, 1.22448673e+03,\n","       4.85654757e+02, 1.30709778e+02, 1.54997227e+01, 5.95238095e-02,\n","       2.43809524e-02, 5.50986923e-01, 4.58334020e+01, 3.50464999e+02,\n","       1.27200240e+03, 3.19694301e+03, 5.84711073e+03, 8.57024623e+03,\n","       1.06775424e+04, 1.19000918e+04, 1.23555360e+04, 1.24402093e+04,\n","       1.23586522e+04, 1.21992581e+04, 1.22280936e+04, 1.23162507e+04,\n","       1.22510127e+04, 1.16314635e+04, 1.00849238e+04, 7.71018098e+03,\n","       5.16732671e+03, 2.99318809e+03, 1.58471510e+03, 7.70678750e+02,\n","       2.90603130e+02, 7.36919311e+01, 9.81920114e+00, 3.62142857e-02,\n","       2.28809524e-02, 2.76185941e-03, 2.81056704e+01, 2.04208025e+02,\n","       7.29051694e+02, 2.00572701e+03, 4.21366647e+03, 6.92346357e+03,\n","       9.57389827e+03, 1.14603398e+04, 1.24666788e+04, 1.27682484e+04,\n","       1.26613017e+04, 1.25534327e+04, 1.25998206e+04, 1.23927837e+04,\n","       1.15590439e+04, 9.88953142e+03, 7.53295513e+03, 5.11441259e+03,\n","       3.05547189e+03, 1.66092585e+03, 8.39969863e+02, 3.84512312e+02,\n","       1.34737119e+02, 2.71408189e+01, 3.06857624e+00, 1.23428571e-01,\n","       0.00000000e+00, 0.00000000e+00, 7.31084788e+00, 7.57570670e+01,\n","       3.18535551e+02, 8.92561149e+02, 2.13007164e+03, 4.15513729e+03,\n","       6.67943441e+03, 9.08942045e+03, 1.08768840e+04, 1.18600478e+04,\n","       1.22185140e+04, 1.21488922e+04, 1.16761724e+04, 1.06623427e+04,\n","       8.88180421e+03, 6.72867491e+03, 4.52696553e+03, 2.78125867e+03,\n","       1.57340674e+03, 7.99627345e+02, 3.90776811e+02, 1.74143994e+02,\n","       5.13083781e+01, 8.53411049e+00, 1.14082626e+00, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 3.09874806e+00, 2.12014616e+01,\n","       9.01086432e+01, 2.89578069e+02, 7.37002996e+02, 1.63305438e+03,\n","       3.00614325e+03, 4.75217719e+03, 6.42418657e+03, 7.68266614e+03,\n","       8.23705320e+03, 8.21603450e+03, 7.48615583e+03, 6.25364040e+03,\n","       4.88502834e+03, 3.50985901e+03, 2.25424437e+03, 1.40076179e+03,\n","       7.54457368e+02, 3.85015891e+02, 1.70931569e+02, 7.23728862e+01,\n","       1.53588609e+01, 3.76286683e+00, 2.36378952e-01, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 7.89492516e-02, 3.23002085e+00,\n","       2.66993369e+01, 8.62829380e+01, 2.42567552e+02, 5.74670736e+02,\n","       1.16062824e+03, 1.85908331e+03, 2.63430007e+03, 3.18296192e+03,\n","       3.47208469e+03, 3.42498298e+03, 3.04423070e+03, 2.59463417e+03,\n","       2.08583729e+03, 1.54170230e+03, 1.04262030e+03, 6.17155891e+02,\n","       3.32872699e+02, 1.63141373e+02, 6.60019146e+01, 2.49646484e+01,\n","       2.80197112e+00, 5.64225568e-01, 2.57523810e-01, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n","       5.85748256e+00, 2.32008075e+01, 9.24954784e+01, 2.19439668e+02,\n","       4.27698080e+02, 6.31131067e+02, 9.05773738e+02, 1.16529687e+03,\n","       1.28219277e+03, 1.23351933e+03, 1.09034012e+03, 8.82789099e+02,\n","       7.26724558e+02, 5.23459986e+02, 3.45778063e+02, 2.08353021e+02,\n","       1.10624593e+02, 4.18520306e+01, 1.58110107e+01, 3.40777397e+00,\n","       1.94759195e-02, 8.28809524e-02, 0.00000000e+00, 0.00000000e+00,\n","       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n","       0.00000000e+00, 9.02126602e-01, 5.52653803e+00, 1.54785620e+01,\n","       2.06441456e+01, 3.43017827e+01, 5.21246770e+01, 7.97142975e+01,\n","       1.00081387e+02, 1.02608696e+02, 1.26673478e+02, 1.14405059e+02,\n","       8.98716430e+01, 6.32064973e+01, 3.98525769e+01, 2.14722761e+01,\n","       1.07222715e+01, 3.09714228e+00, 3.58912164e+00, 1.71614970e-01,\n","       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00])"]},"metadata":{"tags":[]},"execution_count":4}]},{"metadata":{"id":"b3Kk8yMGIXeA","colab_type":"code","outputId":"f9ec0786-6d87-45b6-e694-311f9e5bbad0","executionInfo":{"status":"ok","timestamp":1546076957350,"user_tz":-480,"elapsed":1351,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["np.median(X.var().values)"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["1352.2867031801309"]},"metadata":{"tags":[]},"execution_count":5}]},{"metadata":{"id":"12HTlaqdIMZd","colab_type":"code","colab":{}},"cell_type":"code","source":["import numpy as np\n","X_fsvar = VarianceThreshold(np.median(X.var().values)).fit_transform(X)\n","# 只取一半的特征"],"execution_count":0,"outputs":[]},{"metadata":{"id":"g_yLpZvOgirH","colab_type":"code","outputId":"cb021df0-77a7-422d-f812-6f56c9c93868","executionInfo":{"status":"ok","timestamp":1546079370479,"user_tz":-480,"elapsed":657,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":253}},"cell_type":"code","source":["pd.DataFrame(X_fsvar).head()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>0</th>\n","      <th>1</th>\n","      <th>2</th>\n","      <th>3</th>\n","      <th>4</th>\n","      <th>5</th>\n","      <th>6</th>\n","      <th>7</th>\n","      <th>8</th>\n","      <th>9</th>\n","      <th>...</th>\n","      <th>382</th>\n","      <th>383</th>\n","      <th>384</th>\n","      <th>385</th>\n","      <th>386</th>\n","      <th>387</th>\n","      <th>388</th>\n","      <th>389</th>\n","      <th>390</th>\n","      <th>391</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>18</td>\n","      <td>30</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>...</td>\n","      <td>6</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>1</td>\n","      <td>25</td>\n","      <td>130</td>\n","      <td>...</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","<p>5 rows × 392 columns</p>\n","</div>"],"text/plain":["   0    1    2    3    4    5    6    7    8    9   ...   382  383  384  385  \\\n","0    0    0    0    0    0    0    0    0    0    0 ...     0    0    0    0   \n","1    0    0    0    0    0    0    0    0   18   30 ...     0    0    0    0   \n","2    0    0    0    0    0    0    0    0    0    0 ...     0    0    0    0   \n","3    0    0    0    0    0    0    0    0    0    0 ...     6    0    0    0   \n","4    0    0    0    0    0    0    0    1   25  130 ...     0    0    0    0   \n","\n","   386  387  388  389  390  391  \n","0    0    0    0    0    0    0  \n","1    0    0    0    0    0    0  \n","2    0    0    0    0    0    0  \n","3    0    0    0    0    0    0  \n","4    0    0    0    0    0    0  \n","\n","[5 rows x 392 columns]"]},"metadata":{"tags":[]},"execution_count":33}]},{"metadata":{"id":"nH_R_8VEIZRV","colab_type":"code","outputId":"6fa5113b-c414-4ccc-8625-00c1b45bf012","executionInfo":{"status":"ok","timestamp":1546076962776,"user_tz":-480,"elapsed":760,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["X_fsvar.shape"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(42000, 392)"]},"metadata":{"tags":[]},"execution_count":7}]},{"metadata":{"id":"xpWz2TtUdvRJ","colab_type":"text"},"cell_type":"markdown","source":["#### 样本元素"]},{"metadata":{"id":"wMGzf5fEXwPi","colab_type":"code","outputId":"35fa666c-02d6-4636-c86b-acd7147b363f","executionInfo":{"status":"ok","timestamp":1546077219627,"user_tz":-480,"elapsed":614,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":104}},"cell_type":"code","source":["X.info()"],"execution_count":0,"outputs":[{"output_type":"stream","text":["<class 'pandas.core.frame.DataFrame'>\n","RangeIndex: 42000 entries, 0 to 41999\n","Columns: 784 entries, pixel0 to pixel783\n","dtypes: int64(784)\n","memory usage: 251.2 MB\n"],"name":"stdout"}]},{"metadata":{"id":"6me3RmmpYpOB","colab_type":"code","outputId":"2a079ebf-3008-4996-f528-e896e66af384","executionInfo":{"status":"ok","timestamp":1546077350602,"user_tz":-480,"elapsed":650,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["X.values.max()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["255"]},"metadata":{"tags":[]},"execution_count":16}]},{"metadata":{"id":"IIYCLYf3bcWS","colab_type":"code","outputId":"4f93689e-6831-4fc6-ff57-f3d4b94cf5fd","executionInfo":{"status":"ok","timestamp":1546077992100,"user_tz":-480,"elapsed":723,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["X.values.shape"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(42000, 784)"]},"metadata":{"tags":[]},"execution_count":21}]},{"metadata":{"id":"IF-Cr34Pbs-t","colab_type":"code","outputId":"7f1f562b-5c91-4d3d-9f08-26a66645fad8","executionInfo":{"status":"ok","timestamp":1546078102768,"user_tz":-480,"elapsed":3437,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":4369}},"cell_type":"code","source":["set(X.values.ravel())"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["{0,\n"," 1,\n"," 2,\n"," 3,\n"," 4,\n"," 5,\n"," 6,\n"," 7,\n"," 8,\n"," 9,\n"," 10,\n"," 11,\n"," 12,\n"," 13,\n"," 14,\n"," 15,\n"," 16,\n"," 17,\n"," 18,\n"," 19,\n"," 20,\n"," 21,\n"," 22,\n"," 23,\n"," 24,\n"," 25,\n"," 26,\n"," 27,\n"," 28,\n"," 29,\n"," 30,\n"," 31,\n"," 32,\n"," 33,\n"," 34,\n"," 35,\n"," 36,\n"," 37,\n"," 38,\n"," 39,\n"," 40,\n"," 41,\n"," 42,\n"," 43,\n"," 44,\n"," 45,\n"," 46,\n"," 47,\n"," 48,\n"," 49,\n"," 50,\n"," 51,\n"," 52,\n"," 53,\n"," 54,\n"," 55,\n"," 56,\n"," 57,\n"," 58,\n"," 59,\n"," 60,\n"," 61,\n"," 62,\n"," 63,\n"," 64,\n"," 65,\n"," 66,\n"," 67,\n"," 68,\n"," 69,\n"," 70,\n"," 71,\n"," 72,\n"," 73,\n"," 74,\n"," 75,\n"," 76,\n"," 77,\n"," 78,\n"," 79,\n"," 80,\n"," 81,\n"," 82,\n"," 83,\n"," 84,\n"," 85,\n"," 86,\n"," 87,\n"," 88,\n"," 89,\n"," 90,\n"," 91,\n"," 92,\n"," 93,\n"," 94,\n"," 95,\n"," 96,\n"," 97,\n"," 98,\n"," 99,\n"," 100,\n"," 101,\n"," 102,\n"," 103,\n"," 104,\n"," 105,\n"," 106,\n"," 107,\n"," 108,\n"," 109,\n"," 110,\n"," 111,\n"," 112,\n"," 113,\n"," 114,\n"," 115,\n"," 116,\n"," 117,\n"," 118,\n"," 119,\n"," 120,\n"," 121,\n"," 122,\n"," 123,\n"," 124,\n"," 125,\n"," 126,\n"," 127,\n"," 128,\n"," 129,\n"," 130,\n"," 131,\n"," 132,\n"," 133,\n"," 134,\n"," 135,\n"," 136,\n"," 137,\n"," 138,\n"," 139,\n"," 140,\n"," 141,\n"," 142,\n"," 143,\n"," 144,\n"," 145,\n"," 146,\n"," 147,\n"," 148,\n"," 149,\n"," 150,\n"," 151,\n"," 152,\n"," 153,\n"," 154,\n"," 155,\n"," 156,\n"," 157,\n"," 158,\n"," 159,\n"," 160,\n"," 161,\n"," 162,\n"," 163,\n"," 164,\n"," 165,\n"," 166,\n"," 167,\n"," 168,\n"," 169,\n"," 170,\n"," 171,\n"," 172,\n"," 173,\n"," 174,\n"," 175,\n"," 176,\n"," 177,\n"," 178,\n"," 179,\n"," 180,\n"," 181,\n"," 182,\n"," 183,\n"," 184,\n"," 185,\n"," 186,\n"," 187,\n"," 188,\n"," 189,\n"," 190,\n"," 191,\n"," 192,\n"," 193,\n"," 194,\n"," 195,\n"," 196,\n"," 197,\n"," 198,\n"," 199,\n"," 200,\n"," 201,\n"," 202,\n"," 203,\n"," 204,\n"," 205,\n"," 206,\n"," 207,\n"," 208,\n"," 209,\n"," 210,\n"," 211,\n"," 212,\n"," 213,\n"," 214,\n"," 215,\n"," 216,\n"," 217,\n"," 218,\n"," 219,\n"," 220,\n"," 221,\n"," 222,\n"," 223,\n"," 224,\n"," 225,\n"," 226,\n"," 227,\n"," 228,\n"," 229,\n"," 230,\n"," 231,\n"," 232,\n"," 233,\n"," 234,\n"," 235,\n"," 236,\n"," 237,\n"," 238,\n"," 239,\n"," 240,\n"," 241,\n"," 242,\n"," 243,\n"," 244,\n"," 245,\n"," 246,\n"," 247,\n"," 248,\n"," 249,\n"," 250,\n"," 251,\n"," 252,\n"," 253,\n"," 254,\n"," 255}"]},"metadata":{"tags":[]},"execution_count":22}]},{"metadata":{"id":"8KQFksq5dcSb","colab_type":"text"},"cell_type":"markdown","source":["#### 查看每列元素的类别/每列有多少个不同元素"]},{"metadata":{"id":"_vDBkyzxdFjx","colab_type":"code","outputId":"60772127-5b0d-47d9-fe2a-edb2138e59b2","executionInfo":{"status":"ok","timestamp":1546078545787,"user_tz":-480,"elapsed":633,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["data.iloc[:,0].unique()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([1, 0, 4, 7, 3, 5, 8, 9, 2, 6])"]},"metadata":{"tags":[]},"execution_count":29}]},{"metadata":{"id":"182_Y-sZdoEV","colab_type":"code","outputId":"5cf36dfe-d90a-4b37-ad7a-f6a4dfb1afb4","executionInfo":{"status":"ok","timestamp":1546078561092,"user_tz":-480,"elapsed":512,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":85}},"cell_type":"code","source":["data.iloc[:,40].unique()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([  0, 255,  83, 228, 195,  89, 123, 253, 186,  42,  77, 212, 234,\n","        60, 170,   4,  46, 244,   9, 240, 169, 208, 254, 110, 128, 167,\n","        21,  80,  16, 183,   1, 114,  70,  47, 171, 152, 232, 124, 130,\n","       190])"]},"metadata":{"tags":[]},"execution_count":30}]},{"metadata":{"id":"Z_sxr-MSdAdU","colab_type":"text"},"cell_type":"markdown","source":["#### 标签"]},{"metadata":{"id":"PZiuZ76ecaVF","colab_type":"code","colab":{}},"cell_type":"code","source":["from sklearn.preprocessing import LabelEncoder\n","le = LabelEncoder() #实例化\n","le = le.fit(y) #导入数据\n","label = le.transform(y) #transform接口调取结果"],"execution_count":0,"outputs":[]},{"metadata":{"id":"HV55wog1cjpS","colab_type":"code","outputId":"dcdc6e9e-5b60-4324-dee0-539fd137e56b","executionInfo":{"status":"ok","timestamp":1546078282176,"user_tz":-480,"elapsed":807,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["le.classes_"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])"]},"metadata":{"tags":[]},"execution_count":24}]},{"metadata":{"id":"aCuE5FmMcnYy","colab_type":"code","outputId":"36e41b8a-46c1-45b7-fa05-4d3efaee7dec","executionInfo":{"status":"ok","timestamp":1546078299527,"user_tz":-480,"elapsed":639,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["label[:10]"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([1, 0, 1, 4, 0, 0, 7, 3, 5, 3])"]},"metadata":{"tags":[]},"execution_count":25}]},{"metadata":{"id":"Bb3_5VBrIbBw","colab_type":"code","outputId":"3cf10e3e-dff4-45f5-bd70-e7e20e54180e","executionInfo":{"status":"ok","timestamp":1546076965478,"user_tz":-480,"elapsed":1171,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["#若特征是伯努利随机变量，假设p=0.8，即二分类特征中某种分类占到80%以上的时候删除特征\n","X_bvar = VarianceThreshold(.8 * (1 - .8)).fit_transform(X)\n","X_bvar.shape"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(42000, 685)"]},"metadata":{"tags":[]},"execution_count":8}]},{"metadata":{"id":"c8GHMQgGIivo","colab_type":"text"},"cell_type":"markdown","source":["### 方差过滤对模型的影响  运行时间太长"]},{"metadata":{"id":"PZFRQmmjIfAy","colab_type":"code","colab":{}},"cell_type":"code","source":["#KNN vs 随机森林在不同方差过滤效果下的对比\n","from sklearn.ensemble import RandomForestClassifier as RFC\n","from sklearn.neighbors import KNeighborsClassifier as KNN\n","from sklearn.model_selection import cross_val_score\n","import numpy as np\n","X = data.iloc[:,1:]\n","y = data.iloc[:,0]\n","X_fsvar = VarianceThreshold(np.median(X.var().values)).fit_transform(X)"],"execution_count":0,"outputs":[]},{"metadata":{"id":"knCw3kj3InBX","colab_type":"code","colab":{}},"cell_type":"code","source":["#======【TIME WARNING：35mins +】======#\n","cross_val_score(KNN(),X,y,cv=5).mean()\n","#python中的魔法命令，可以直接使用%%timeit来计算运行这个cell中的代码所需的时间\n","#为了计算所需的时间，需要将这个cell中的代码运行很多次（通常是7次）后求平均值，因此运行%%timeit的时间会远远超过cell中的代码单独运行的时间\n","#======【TIME WARNING：4 hours】======#\n","%%timeit\n","cross_val_score(KNN(),X,y,cv=5).mean()"],"execution_count":0,"outputs":[]},{"metadata":{"id":"Y6lJKwTVI_IE","colab_type":"code","colab":{}},"cell_type":"code","source":["#======【TIME WARNING：20 mins+】======#\n","cross_val_score(KNN(),X_fsvar,y,cv=5).mean()\n","#======【TIME WARNING：2 hours】======#\n","%%timeit\n","cross_val_score(KNN(),X,y,cv=5).mean()"],"execution_count":0,"outputs":[]},{"metadata":{"id":"IYEtK7JqZx3h","colab_type":"text"},"cell_type":"markdown","source":["谨慎处理"]},{"metadata":{"id":"vpUGK5paZnod","colab_type":"code","outputId":"88a05ce1-4591-4183-a449-d47f574957d0","executionInfo":{"status":"ok","timestamp":1546077689241,"user_tz":-480,"elapsed":17284,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["cross_val_score(RFC(n_estimators=10,random_state=0),X,y,cv=5).mean()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0.9380003861799541"]},"metadata":{"tags":[]},"execution_count":18}]},{"metadata":{"id":"uWfRKe2iZnj6","colab_type":"code","outputId":"e3fb6cca-16aa-4414-9b20-87393cad19f1","executionInfo":{"status":"ok","timestamp":1546077762369,"user_tz":-480,"elapsed":66262,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["%%timeit\n","cross_val_score(RFC(n_estimators=10,random_state=0),X,y,cv=5).mean()"],"execution_count":0,"outputs":[{"output_type":"stream","text":["1 loop, best of 3: 16.4 s per loop\n"],"name":"stdout"}]},{"metadata":{"id":"ZgAONcn8ZngG","colab_type":"code","outputId":"b6d41bb9-c0de-4561-bd09-0fcccd9f05c4","executionInfo":{"status":"ok","timestamp":1546077808051,"user_tz":-480,"elapsed":16588,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["cross_val_score(RFC(n_estimators=10,random_state=0),X_fsvar,y,cv=5).mean()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0.9388098166696807"]},"metadata":{"tags":[]},"execution_count":20}]},{"metadata":{"id":"aOnGNzuAgHEg","colab_type":"code","outputId":"25aabbf0-ce8c-4184-e6ae-7a34df2673e1","executionInfo":{"status":"ok","timestamp":1546079290342,"user_tz":-480,"elapsed":79239,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["cross_val_score(RFC(n_estimators=50,random_state=0),X_fsvar,y,cv=5).mean()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0.9617859005967446"]},"metadata":{"tags":[]},"execution_count":31}]},{"metadata":{"id":"nSx8u_IcZ_Xw","colab_type":"text"},"cell_type":"markdown","source":["## 2相关性过滤"]},{"metadata":{"id":"P3OyjdJtlAjZ","colab_type":"text"},"cell_type":"markdown","source":["### 卡方过滤"]},{"metadata":{"id":"cp583Ut6aA1_","colab_type":"code","outputId":"3dd80856-113e-4cef-b8d3-f983b2f3bf16","executionInfo":{"status":"ok","timestamp":1546079731024,"user_tz":-480,"elapsed":2169,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["from sklearn.ensemble import RandomForestClassifier as RFC\n","from sklearn.model_selection import cross_val_score\n","from sklearn.feature_selection import SelectKBest\n","from sklearn.feature_selection import chi2\n","#假设在这里我一直我需要300个特征\n","X_fschi = SelectKBest(chi2, k=300).fit_transform(X_fsvar, y)\n","X_fschi.shape"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(42000, 300)"]},"metadata":{"tags":[]},"execution_count":34}]},{"metadata":{"id":"wz8YSblSalqp","colab_type":"code","outputId":"c3a033f7-5463-42da-b582-ed37d97efd9c","executionInfo":{"status":"ok","timestamp":1546079765521,"user_tz":-480,"elapsed":14850,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["cross_val_score(RFC(n_estimators=10,random_state=0),X_fschi,y,cv=5).mean()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0.9333098667649198"]},"metadata":{"tags":[]},"execution_count":35}]},{"metadata":{"id":"gLda1yabal3r","colab_type":"code","colab":{}},"cell_type":"code","source":["#======【TIME WARNING: 5 mins】======#\n","%matplotlib inline\n","import matplotlib.pyplot as plt\n","score = []\n","for i in range(390,200,-10):\n","    X_fschi = SelectKBest(chi2, k=i).fit_transform(X_fsvar, y)\n","    once = cross_val_score(RFC(n_estimators=10,random_state=0),X_fschi,y,cv=5).mean()\n","    score.append(once)"],"execution_count":0,"outputs":[]},{"metadata":{"id":"1BoV0_jrifLO","colab_type":"code","outputId":"5f2880cb-09f9-4152-a0b2-9cbb8a228977","executionInfo":{"status":"ok","timestamp":1546080130036,"user_tz":-480,"elapsed":621,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":265}},"cell_type":"code","source":["plt.plot(range(390,200,-10),score)\n","plt.show()"],"execution_count":0,"outputs":[{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAX0AAAD4CAYAAAAAczaOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xd4VPeB7vHvjCqqCCQhBEii/qgG\nA7YpprnTjLtT3BI2ySb2c72bZPc6u7l3U54n3rU3Zb32Ok5uXGLHNi6YmGoMNmAbbNOb4UeVQFQJ\n9V7m3D9mRGQsUGGkmdG8n+fhQTPnzDnvGY7eOfzmzBmX4ziIiEh4cAc6gIiIdB2VvohIGFHpi4iE\nEZW+iEgYUemLiISRyEAHuJSCgvKgP7UoJSWO4uKqQMdoVajkhNDJqpz+FSo5IfizpqUlui42TUf6\nlykyMiLQEdokVHJC6GRVTv8KlZwQWlkvpNIXEQkjKn0RkTCi0hcRCSMqfRGRMNKms3eMMb8FJgEO\n8Ki1dnOzaQuAnwK1wOvW2qebTesB7AF+aa190RgzAHgZiABOAfdba2v9tTEiInJprR7pG2NmAEOt\ntZOBhcBTzaa5gaeBOcB0YL4xpn+zh/8UKGp2+xfAM9baacAh4NuXvQUiItJmbRneuR5YAmCt3Qek\nGGOSfNNSgRJrbYG11gOs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wAF+3uxIO5BZH8A7bnu42XwfAQ8aYzbhfVP6cWvtiS7M+XvgT8aYj4Ae\neMfGtwB/NsZ8D8gDXrLW1gf4OW0p50/wjt+v880TDPtoSzkrCM599CtZrbUe39BNMO2j7abr6YuI\nhBEN74iIhBGVvohIGFHpi4iEEZW+iEgYUemLiIQRlb6ISBhR6YuIhJH/D8ZZQbkvbXqaAAAAAElF\nTkSuQmCC\n","text/plain":["<matplotlib.figure.Figure at 0x7f2061eff208>"]},"metadata":{"tags":[]}}]},{"metadata":{"id":"7tbKdZMCjpCx","colab_type":"code","colab":{}},"cell_type":"code","source":["chivalue, pvalues_chi = chi2(X_fsvar,y)"],"execution_count":0,"outputs":[]},{"metadata":{"id":"n8QL_RK9j-9R","colab_type":"code","outputId":"312ab899-d0ca-49c7-8fe8-20e93d3a1b65","executionInfo":{"status":"ok","timestamp":1546080234115,"user_tz":-480,"elapsed":637,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":2244}},"cell_type":"code","source":["chivalue"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([ 945664.84392643, 1244766.05139164, 1554872.30384525,\n","       1834161.78305343, 1903618.94085294, 1845226.62427198,\n","       1602117.23307537,  708535.17489837,  974050.20513718,\n","       1188092.19961931, 1319151.43467036, 1397847.8836796 ,\n","       1433554.26798015, 1429043.15373433, 1332663.17213405,\n","       1101423.25372261,  809989.56940485,  519266.71772284,\n","        285681.88297156,  191589.23696468,  902883.1255264 ,\n","       1237265.16042373, 1503477.73699155, 1625807.41495542,\n","       1630206.90922916, 1630597.02883804, 1633456.72909664,\n","       1610816.75571229, 1483382.49543886, 1256290.1574794 ,\n","        951236.1617682 ,  693192.66191748,  532386.96220361,\n","        504617.38933715,  575090.36046243,  501025.03733245,\n","        802341.10683194, 1078344.8724406 , 1226540.98318702,\n","       1269945.07968831, 1221758.57688808, 1146535.17810241,\n","       1080657.20185303, 1079065.30979135, 1092222.70610032,\n","       1064908.45385716, 1023327.00231067,  974163.15420165,\n","        918857.12860617,  861439.52030749,  828439.23565047,\n","        916454.89464771,  989713.58229958,  543695.5016699 ,\n","        674691.76755044,  708113.57226969,  657819.3908855 ,\n","        599159.21961671,  576483.60795847,  559848.1818137 ,\n","        536985.56062372,  561457.57734769,  594428.19185935,\n","        592414.89830452,  587801.84097643,  672232.60135169,\n","        790511.70530618,  866573.70991777,  891422.58050934,\n","        905163.15191882, 1006322.94034634,  585209.83598254,\n","        699596.88963547,  705326.82387203,  641105.0929774 ,\n","        632098.97938142,  725189.43548604,  853879.48154986,\n","        863895.50862873,  709440.99808713,  615099.361498  ,\n","        660082.35138802,  662040.13166049,  647432.43321103,\n","        718070.06251003,  868119.93550552,  995128.78948214,\n","        981295.46383871,  888906.74357254,  803951.63399892,\n","        775220.92445238,  802661.20360682,  806753.10120013,\n","        827660.8911231 , 1008184.76195542, 1212658.65697336,\n","       1279652.35847441, 1071947.51866571,  712579.55021262,\n","        708178.91784269,  931871.22430817,  836155.03350401,\n","        781584.17446604,  883252.58134165, 1015304.18853993,\n","       1153480.28062008, 1235182.10720641, 1110286.29490637,\n","        762412.0228271 ,  651475.7374445 ,  659784.45490334,\n","        761439.40964843,  980458.35707785, 1285689.5977369 ,\n","       1412800.83270279, 1269424.03486304,  844394.53343881,\n","        453037.70035635,  906205.5333485 , 1314337.38985735,\n","        875502.64893107,  848574.25317153, 1088364.70535319,\n","       1143964.61799576, 1231934.57606489, 1525266.11466634,\n","       1624923.27849511, 1120921.66905394,  381196.04594987,\n","        517011.13080559,  840830.08443577, 1249668.53527256,\n","       1487299.06201808, 1440993.69232521, 1234157.54433962,\n","        891091.32709079,  767327.74644144, 1767505.95851489,\n","       1794612.36340341,  843649.64862696,  974860.15688277,\n","       1282142.9789604 , 1121437.99502364, 1158258.4373389 ,\n","       1803319.16430163, 2247538.01212782, 1715860.1009172 ,\n","        308268.96279553,  670765.24199637, 1175840.18589306,\n","       1569563.41213805, 1615071.70298461, 1453812.39367812,\n","       1429193.59276003, 1469624.15320088, 1610038.8334007 ,\n","       2381990.83018419, 1684641.44646863,  781514.82471784,\n","       1136274.26981954, 1258505.95202954,  900621.20914746,\n","       1033026.39393914, 2032592.30559197, 2688297.40292302,\n","       2126052.31008566,  477854.94097719, 1061876.2951535 ,\n","       1617721.02614334, 1859303.87013649, 1706658.49975169,\n","       1442798.15960511, 1497467.99791583, 1635633.52918659,\n","       1789954.0440811 , 2042036.97897042, 1243975.13567915,\n","        847897.40531407, 1334491.44036763, 1146547.23628072,\n","        721408.29456933, 1099901.34212844, 2234797.26301007,\n","       2788060.61506624, 2097404.45292914,  770825.17396301,\n","       1509971.18325275, 2008828.59327289, 2076128.28182046,\n","       1775258.41727455, 1374882.05100453, 1223860.78474695,\n","       1190499.55493678, 1469994.89713294, 1556218.16894472,\n","        936604.6211571 , 1052799.96220046, 1487484.96092392,\n","       1096221.91497984,  754081.7574313 , 1308952.47883141,\n","       2269151.28497174, 2519422.4441161 , 1816912.55593098,\n","       1090497.85622876, 1822356.78804369, 2192372.5304657 ,\n","       2133745.04961112, 1807649.67676254, 1420349.92183107,\n","       1222343.35267926, 1165504.99607627, 1500572.78318498,\n","       1432663.59271325,  890862.82928644, 1274280.76943075,\n","       1432072.36165076,  956997.59590817,  888742.14373383,\n","       1508163.46238821, 2117988.12236915, 2054465.38907916,\n","       1423918.25987689, 1286013.85962749, 1972608.25057539,\n","       2179634.12755044, 1979740.23184782, 1717723.16781811,\n","       1552275.10457858, 1461315.1411536 , 1494620.94971976,\n","       1739520.65681857, 1442815.46046628, 1014723.34171191,\n","       1363794.15539944, 1122747.63831017,  739634.35332833,\n","       1067567.31929299, 1667592.5097389 , 1864455.97854722,\n","       1579099.16973703,  967688.45447601, 1416605.83453248,\n","       2062165.61891584, 2170645.77302745, 1901786.79198259,\n","       1733725.85760386, 1753508.37671084, 1712712.42549789,\n","       1733493.582237  , 1770340.59820148, 1310901.04423274,\n","       1008023.90988477, 1061378.72275934,  662457.8217003 ,\n","        729648.40292041, 1370253.32454603, 1741943.51510473,\n","       1593454.39731162, 1172442.70958932,  671601.50140396,\n","        511587.36577997, 1454955.01309647, 2126817.74478926,\n","       2263953.8025206 , 2028172.33782053, 1992515.52928071,\n","       2172520.74824953, 2035403.53821729, 1758624.07224114,\n","       1514817.58748747, 1002116.10560135,  669379.60246184,\n","        544978.32282227,  576722.03477821, 1098371.32650041,\n","       1603057.05343338, 1612844.96289426, 1293107.69776289,\n","        917550.19379029,  683222.7639966 ,  608782.99701169,\n","       1391473.37940334, 2082151.30610954, 2298916.31712188,\n","       2140360.89085296, 2070900.53848134, 2159471.16950063,\n","       1981772.43302263, 1521754.51234479, 1076334.48566226,\n","        610262.09016783,  351852.98340462,  461487.7601437 ,\n","        878540.35993713, 1337597.14727232, 1481891.62067955,\n","       1342562.57238699, 1127940.79389167,  958491.4694589 ,\n","        884951.02023249,  671520.41386273, 1232265.31295026,\n","       1877169.85821324, 2239501.99047448, 2199634.11766741,\n","       1930471.52367226, 1666073.70450191, 1364054.30645472,\n","       1000936.25390226,  656080.48075838,  389810.08772878,\n","        340150.21186292,  602275.43941511,  959623.37641551,\n","       1156974.48558905, 1135816.98677808, 1044294.97185606,\n","        992281.03054232,  964376.78121192,  966024.75721634,\n","       1491250.50567589, 1970679.86657318, 2139321.52912066,\n","       1894361.40873889, 1368494.5514217 ,  829396.07488768,\n","        488455.25931088,  331978.08818759,  293365.6522867 ,\n","        387474.16211622,  600489.80555106,  783767.50733716,\n","        831013.99296771,  768407.80393857,  738760.56078587,\n","        761413.22072658,  781528.79224194,  615612.72460389,\n","        975765.83585216, 1382346.6477236 , 1684701.13053512,\n","       1732335.2436048 , 1492804.58962318, 1144230.23099215,\n","        852589.97157847,  719215.03719448,  675891.53891187,\n","        687917.5152402 ,  708292.70911948,  673810.32849758,\n","        550803.45299243,  428370.7943997 ,  384587.47807058,\n","        407022.00975206,  441201.32284902,  661202.45504685,\n","        904150.80474087, 1098249.34334037, 1225055.2730661 ,\n","       1312843.88397644, 1325774.40817926, 1236093.76813092,\n","       1036608.01098297,  829620.55626671,  654964.88596563,\n","        520032.72156302,  387948.22204601,  273436.39846809,\n","        203015.85080751,  255471.93956392,  389884.80778864,\n","        561308.92316732,  759511.94695328,  942402.80700557,\n","       1044698.95132913, 1009807.32615993,  844407.23356341,\n","        695110.21243546,  637789.62877943,  600582.89899187,\n","        519392.9652949 ,  399631.65341907, 1006027.89058975,\n","       1352052.90333271, 1647606.90721159, 1761733.4081397 ,\n","       1664096.76785043, 1396834.58681766, 1159784.3628775 ,\n","       1001178.01359166,  847886.28143964])"]},"metadata":{"tags":[]},"execution_count":39}]},{"metadata":{"id":"QXyQd2rTkBfg","colab_type":"code","outputId":"47d1e8d9-ed05-43fd-940f-f63cb53b36d8","executionInfo":{"status":"ok","timestamp":1546080243319,"user_tz":-480,"elapsed":641,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":425}},"cell_type":"code","source":["pvalues_chi"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n","       0.])"]},"metadata":{"tags":[]},"execution_count":40}]},{"metadata":{"id":"SlzPOR1CkWmm","colab_type":"code","outputId":"230953b7-90d7-4bf0-aa2e-4d542906d0df","executionInfo":{"status":"ok","timestamp":1546080319281,"user_tz":-480,"elapsed":657,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["chivalue.shape[0]"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["392"]},"metadata":{"tags":[]},"execution_count":41}]},{"metadata":{"id":"WAMttYVZkD50","colab_type":"code","outputId":"6220b640-823b-4ce7-d4f3-fb50142a8663","executionInfo":{"status":"ok","timestamp":1546080328906,"user_tz":-480,"elapsed":670,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["#k取多少？我们想要消除所有p值大于设定值，比如0.05或0.01的特征：\n","k = chivalue.shape[0] - (pvalues_chi > 0.05).sum()\n","k"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["392"]},"metadata":{"tags":[]},"execution_count":42}]},{"metadata":{"id":"hnZdlDKakQBU","colab_type":"code","colab":{}},"cell_type":"code","source":["#X_fschi = SelectKBest(chi2, k=填写具体的k).fit_transform(X_fsvar, y)\n","#cross_val_score(RFC(n_estimators=10,random_state=0),X_fschi,y,cv=5).mean()\n"],"execution_count":0,"outputs":[]},{"metadata":{"id":"-R_zPLG3kkdZ","colab_type":"text"},"cell_type":"markdown","source":["### F检验"]},{"metadata":{"id":"6jv1ubgslmo2","colab_type":"text"},"cell_type":"markdown","source":["需要注意的是，F检验在数据服从正态分布时效果会非常稳定，因此如果使用F检验过滤，我\n","们会先将数据转换成服从正态分布的方式"]},{"metadata":{"id":"JyQmp7JBkglK","colab_type":"code","colab":{}},"cell_type":"code","source":["from sklearn.feature_selection import f_classif\n","F, pvalues_f = f_classif(X_fsvar,y)"],"execution_count":0,"outputs":[]},{"metadata":{"id":"HDOCC-IUksZZ","colab_type":"code","outputId":"50469f30-e671-4893-8874-2c3eab00b082","executionInfo":{"status":"ok","timestamp":1546080416868,"user_tz":-480,"elapsed":664,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":1683}},"cell_type":"code","source":["F"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([ 618.65383492,  846.18897012, 1115.40617051, 1362.3677305 ,\n","       1452.03355369, 1381.09095571, 1138.26505266,  464.29616121,\n","        660.00977785,  849.66393412, 1004.7450309 , 1124.76177588,\n","       1200.99190762, 1209.29489877, 1110.4944286 ,  854.66183292,\n","        577.52063451,  342.09729054,  178.67397866,  118.01145533,\n","        612.12261014,  899.40904291, 1196.17528948, 1424.49864852,\n","       1569.26556677, 1742.49910702, 1910.98023795, 1969.20520223,\n","       1731.37475948, 1295.09668012,  839.15325001,  531.97951763,\n","        371.82392681,  336.00820537,  378.93378743,  317.47025479,\n","        528.94881012,  766.40792176,  947.63168717, 1086.0472161 ,\n","       1177.72017709, 1253.79641973, 1344.06961068, 1507.33781169,\n","       1616.50454434, 1512.25864876, 1289.65180587, 1051.26276412,\n","        839.48869386,  680.07426932,  600.85538567,  633.55772663,\n","        683.96908509,  347.65867784,  452.76238211,  509.16387684,\n","        515.7498157 ,  532.86107778,  594.62512658,  664.18740444,\n","        709.37133696,  798.11767931,  876.69849088,  852.76926441,\n","        785.70173347,  802.88980095,  813.2041131 ,  760.85552527,\n","        687.94148028,  642.84071735,  698.11530217,  367.16414289,\n","        455.90449427,  485.50500277,  476.23046034,  536.72332365,\n","        740.12587382, 1041.38089649, 1168.8028973 ,  941.91083922,\n","        795.72843454,  861.29818828,  868.19464432,  838.80173567,\n","        886.26659655,  959.12740961,  934.56890789,  783.1988476 ,\n","        631.01107034,  542.02937189,  493.83337615,  533.27899195,\n","        572.34131749,  657.20547321,  981.66873526, 1465.82267956,\n","       1756.05831022, 1385.28086085,  798.73125604,  761.40508874,\n","       1062.6919609 ,  979.38193965,  947.82602644, 1085.00522683,\n","       1152.13801689, 1118.1595422 , 1021.13086631,  812.37823266,\n","        509.86857625,  411.37986706,  430.7150329 ,  545.55866945,\n","        829.92259533, 1376.4852629 , 1811.62922878, 1601.33613631,\n","        898.8719158 ,  417.37765921,  895.77244253, 1455.38592931,\n","        956.2421521 ,  990.1748413 , 1359.47406197, 1279.27992017,\n","       1166.80888121, 1291.41792351, 1263.86987819,  787.81807986,\n","        237.21811742,  333.12552194,  621.47324186, 1139.04489426,\n","       1713.54508435, 1823.42451065, 1436.53069242,  884.19442779,\n","        717.63373994, 2026.90370414, 2219.46450157,  943.55587655,\n","       1217.29127813, 1677.03878308, 1193.63540136, 1039.56842784,\n","       1570.18098323, 1878.5600272 , 1284.78903715,  190.02740438,\n","        444.17019739,  928.80156872, 1562.54171587, 1940.54801063,\n","       1816.57346013, 1683.83193784, 1619.17496376, 1865.78706551,\n","       3482.82350415, 2326.10253286,  990.67999393, 1632.46650414,\n","       1652.51500198,  891.26746579,  883.96689508, 1805.57103626,\n","       2389.97435433, 1630.34926872,  301.84091297,  746.3286491 ,\n","       1394.82469151, 2008.19411716, 2107.3680475 , 1767.97892382,\n","       1786.08753011, 1980.1986791 , 2509.14739387, 3366.13986444,\n","       1959.90573326, 1299.36608875, 2218.28123025, 1470.25657381,\n","        681.02610086,  937.54741741, 2037.45812231, 2518.68810085,\n","       1583.0009463 ,  509.76276636, 1139.21364745, 1881.71834116,\n","       2351.30851824, 2175.48525458, 1624.49647062, 1399.44534221,\n","       1440.98664744, 2229.25720739, 2764.00452882, 1633.74258116,\n","       1870.29253742, 2628.79930504, 1367.31440177,  707.38857243,\n","       1150.06936228, 2089.08213594, 2185.00557858, 1318.14722036,\n","        747.37697661, 1453.94015412, 2116.40726513, 2399.53090598,\n","       2143.53519978, 1651.89817908, 1414.71662551, 1481.62100314,\n","       2468.21266727, 2666.18025642, 1520.6400065 , 2223.14029953,\n","       2271.07109628, 1111.06997494,  844.31183874, 1388.60413626,\n","       1917.10207189, 1667.61400215,  996.09054823,  907.80926355,\n","       1607.70263546, 2085.21461056, 2073.68356276, 1880.26929744,\n","       1756.40165025, 1716.45478479, 1964.08537105, 2796.13761562,\n","       2413.09378391, 1543.01310963, 2118.10377396, 1475.29541488,\n","        783.59003763, 1040.65400476, 1582.46200024, 1617.32566033,\n","       1188.24554305,  642.2665701 , 1011.30241064, 1725.70185142,\n","       2067.20755476, 1893.35116837, 1795.96538455, 1922.58627318,\n","       1951.69309645, 2115.44871238, 2479.27958039, 1809.12095649,\n","       1330.8686207 , 1396.29767244,  741.9063402 ,  751.14036409,\n","       1410.18529816, 1677.6595494 , 1308.77910167,  836.77047561,\n","        430.93133677,  313.888671  , 1039.31894918, 1811.68171256,\n","       2191.69964967, 2035.63638826, 2114.65218363, 2511.27142071,\n","       2363.46743373, 2053.7687027 , 1865.84769096, 1202.94179711,\n","        793.61414555,  633.71267282,  636.18282736, 1218.61245591,\n","       1712.62901816, 1484.60290068,  996.06129466,  626.13659134,\n","        441.56356583,  374.08815796,  983.21640593, 1764.93014215,\n","       2264.93587233, 2262.87269162, 2323.50890468, 2611.66920897,\n","       2387.45723028, 1763.5696083 , 1256.32165954,  704.77285945,\n","        406.94580935,  548.06969664, 1051.50016486, 1542.11172909,\n","       1494.38472469, 1130.61174365,  823.84437277,  650.69506052,\n","        594.18011033,  415.73313115,  853.97575783, 1548.7167469 ,\n","       2204.00694989, 2444.69535795, 2267.62871155, 2003.69161124,\n","       1643.94961527, 1202.35520102,  804.18805494,  483.32932365,\n","        420.99263006,  750.06949525, 1136.32227345, 1202.49476981,\n","        990.75097727,  791.03016258,  692.46641159,  653.96372577,\n","        647.90433225, 1149.80460733, 1826.54973661, 2361.75564926,\n","       2313.09139096, 1694.26613916, 1012.97938867,  608.4174945 ,\n","        432.07115684,  383.54620406,  487.70312805,  698.78061024,\n","        797.0763827 ,  714.70722998,  574.2849126 ,  507.5143557 ,\n","        508.77434021,  510.36884435,  404.13860698,  686.31274396,\n","       1103.81003251, 1590.83695172, 1912.74984902, 1832.62220523,\n","       1482.39046946, 1142.10827805,  968.65089356,  860.24853405,\n","        780.75215696,  696.78170045,  567.41403081,  403.59649375,\n","        284.91007929,  245.59060983,  255.97458001,  293.6787996 ,\n","        460.46868009,  687.29383613,  940.06512113, 1205.58777055,\n","       1485.37178744, 1623.12886955, 1488.04856361, 1119.91615126,\n","        770.06544455,  530.6398126 ,  376.66549502,  258.05875548,\n","        172.20323661,  123.79865884,  160.44132806,  249.15104257,\n","        374.15221131,  544.73535425,  727.78945347,  853.98680046,\n","        819.19801306,  656.55547718,  510.87851723,  445.09613969,\n","        401.25608847,  333.48574029,  243.88699402,  645.9545719 ,\n","        920.3259526 , 1196.07900013, 1308.12260763, 1218.37705687,\n","        996.41501921,  792.59409228,  663.47516843,  550.14745143])"]},"metadata":{"tags":[]},"execution_count":44}]},{"metadata":{"id":"KQzaFPPjkubE","colab_type":"code","outputId":"cf767261-604c-4371-c0d9-cd2281ff924a","executionInfo":{"status":"ok","timestamp":1546080424815,"user_tz":-480,"elapsed":700,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":1683}},"cell_type":"code","source":["pvalues_f"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 4.71193533e-220,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       3.26083326e-322, 5.24336441e-231, 4.04009647e-300, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000,\n","       0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000])"]},"metadata":{"tags":[]},"execution_count":45}]},{"metadata":{"id":"m9sN2_flkwP-","colab_type":"code","outputId":"eaf59857-1be9-4008-b6a8-9c7c277f7a65","executionInfo":{"status":"ok","timestamp":1546080442231,"user_tz":-480,"elapsed":643,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":34}},"cell_type":"code","source":["k = F.shape[0] - (pvalues_f > 0.05).sum()\n","k"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["392"]},"metadata":{"tags":[]},"execution_count":46}]},{"metadata":{"id":"XBBQMY2Tk0o_","colab_type":"code","colab":{}},"cell_type":"code","source":["#X_fsF = SelectKBest(f_classif, k=填写具体的k).fit_transform(X_fsvar, y)\n","#cross_val_score(RFC(n_estimators=10,random_state=0),X_fsF,y,cv=5).mean()"],"execution_count":0,"outputs":[]},{"metadata":{"id":"O3YL7I3xk6w9","colab_type":"text"},"cell_type":"markdown","source":["### 互信息法"]},{"metadata":{"id":"SREBlSKqmny9","colab_type":"text"},"cell_type":"markdown","source":["返回“每个特征与目标之间的互信息量的估计”，这个估计量在[0,1]之间取值，为0则表示两个变量独立，为1则表示两个变量完全相关"]},{"metadata":{"id":"348JtTRvk71z","colab_type":"code","outputId":"64b6cfb0-18ae-448d-b99c-2f3e09a3f326","executionInfo":{"status":"ok","timestamp":1546080726880,"user_tz":-480,"elapsed":172117,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["from sklearn.feature_selection import mutual_info_classif as MIC\n","result = MIC(X_fsvar,y)\n","k = result.shape[0] - sum(result <= 0)\n","k"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["392"]},"metadata":{"tags":[]},"execution_count":47}]},{"metadata":{"id":"57ZDhxuglQLs","colab_type":"code","colab":{}},"cell_type":"code","source":["#X_fsmic = SelectKBest(MIC, k=填写具体的k).fit_transform(X_fsvar, y)\n","#cross_val_score(RFC(n_estimators=10,random_state=0),X_fsmic,y,cv=5).mean()"],"execution_count":0,"outputs":[]},{"metadata":{"id":"hCk4kjgXnEqe","colab_type":"text"},"cell_type":"markdown","source":["## 3Embedded嵌入法"]},{"metadata":{"id":"iVEWHgMYnJHm","colab_type":"code","colab":{}},"cell_type":"code","source":["from sklearn.feature_selection import SelectFromModel\n","from sklearn.ensemble import RandomForestClassifier as RFC\n","RFC_ = RFC(n_estimators =10,random_state=0)\n","X_embedded = SelectFromModel(RFC_,threshold=0.005).fit_transform(X,y)\n","#在这里我只想取出来有限的特征。0.005这个阈值对于有780个特征的数据来说，是非常高的阈值，因为平均每个特征只能够分到大约0.001的feature_importances_\n"],"execution_count":0,"outputs":[]},{"metadata":{"id":"fe28xqFMnU-g","colab_type":"code","outputId":"fab1a29c-a979-448c-f71a-16bc98c150c8","executionInfo":{"status":"ok","timestamp":1546081111493,"user_tz":-480,"elapsed":667,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["X_embedded.shape"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(42000, 47)"]},"metadata":{"tags":[]},"execution_count":49}]},{"metadata":{"id":"A4ID8r6dnX6B","colab_type":"code","colab":{}},"cell_type":"code","source":["#模型的维度明显被降低了\n","#同样的，我们也可以画学习曲线来找最佳阈值\n"],"execution_count":0,"outputs":[]},{"metadata":{"id":"LQCtuDN7tdSI","colab_type":"code","outputId":"7a193c4b-94e9-435c-aff5-5d52e926d487","executionInfo":{"status":"ok","timestamp":1546082705905,"user_tz":-480,"elapsed":667,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":86}},"cell_type":"code","source":["threshold"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([0.        , 0.00067177, 0.00134354, 0.00201531, 0.00268707,\n","       0.00335884, 0.00403061, 0.00470238, 0.00537415, 0.00604592,\n","       0.00671769, 0.00738945, 0.00806122, 0.00873299, 0.00940476,\n","       0.01007653, 0.0107483 , 0.01142007, 0.01209183, 0.0127636 ])"]},"metadata":{"tags":[]},"execution_count":60}]},{"metadata":{"id":"Mk995rCRnaPA","colab_type":"code","outputId":"1ad8afcf-9d2c-4c32-841c-82a60c38fb0a","executionInfo":{"status":"ok","timestamp":1546081629254,"user_tz":-480,"elapsed":229433,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":265}},"cell_type":"code","source":["#======【TIME WARNING：10 mins】======#\n","import numpy as np\n","import matplotlib.pyplot as plt\n","RFC_.fit(X,y).feature_importances_\n","threshold = np.linspace(0,(RFC_.fit(X,y).feature_importances_).max(),20)\n","score = []\n","for i in threshold:\n","    X_embedded = SelectFromModel(RFC_,threshold=i).fit_transform(X,y)\n","    once = cross_val_score(RFC_,X_embedded,y,cv=5).mean()\n","    score.append(once)\n","plt.plot(threshold,score)\n","plt.show()"],"execution_count":0,"outputs":[{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xl0lPd97/H3bJKQNFqAAUmI3eLH\nYmMDNgZjwDZObCe1GztOb26bHpP4Jk3rtk7vco673iS9bXKbm5CkyTk3zknsNDdLk7ghdrzGBrzJ\nCwaDbQxfwKySQEggkJCE9vvHjEDIFhpJM3rmkT6vc3SkeZaZD3OYzzzze555nkBPTw8iIuJfQa8D\niIjIyKjIRUR8TkUuIuJzKnIREZ9TkYuI+Fx4tB+wrq5p2IfJFBfn0tDQkso4o0r5vePn7KD8XsuE\n/LFYNDDQPF9tkYfDIa8jjIjye8fP2UH5vZbp+X1V5CIi8n4qchERn1ORi4j4nIpcRMTnVOQiIj6n\nIhcR8TkVuYiIz436F4JG4uSZVqrrm+no7KKjs/vin64Pvt15/nYXXd09TMgOk58TIW9ChNycMHk5\nEfImxKfl5oTJzQkTCur9TUT8wzdFvs3q+O6v3x6Vx5qQHSavT8nn5UTitydEiE6IEM3NIpp78e9I\nWOUvIt7wTZHPLo3y0VWzaWlpJxIOxn9C8d/hfrcvnh86fzsYgNa2LprPddB8rpPm1o5+f/f5fa6D\nY6eaae/oTipfTlboQrlPiBDNS5T8hAtlP721k9bmNrIiQbIjIbIioUSuAb95KyIyKN8U+cSCHD5/\n12Lq6ppG9XE7OrtpOdfB2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dxvHTDJZ/kB/gb4LtDus+y3Az9JTH/QzB7t/2AZnr+eC/9fihO3MzF/G/AR4hd07+sGRve1m8rs\nXrxu38frIi8h/o/vVZeY9kHzTgCll1gnr8/Hsd5l0y1l+c2s2cy6nHMh4tdF/WnaUl+QsvzOuXnA\nlWb2y/TFvUgq/+/MAm5zzm1xzv3cOTcxXaH7SGX+vwI2OueM+KeJh9MT+SJDzm9mnWb2QVc/Hu3X\nbsqye/S6fR+vi7y/S42rDjTvg6anfXx2ACPKn/jP8GNgk5n1/wg3GkaSfwMefazsl2Mo8wJ9fpuZ\n3QC8Q3x4aLSNJP+/AneamQNeIr6VONqGk3+ky6bKiLJnwOvW8yKv4cI7IUAZF8ZX+8+blpg20Dpn\nnXMT+i2bbqnMD/GdJvvM7EtpSft+qcrfBswHfuKcexUodc49n67QA+QbyXNfC/TmfRpYlIa8/aUy\n/2Izezkx7XfA1ekI3M9w8g9ktF+7qcwOo/+6fR+vi/wZ4G4A59xSoMbMmgDM7BBQ4Jyb5ZwLA7+X\nWH6gdZ4lvoOCxO+n/JTfOfdHQLuZ/c9RyJ3q/IfNbK6ZrTCzFcCxxM4fP2RvAp4Ebk3c7zLA0pw9\n1fmPO+cWJu73GmBfhuYfyGi/dlOW3aPX7ft4fhpb59xXgTVAN/ExpiXAGTP7deKwqv+dWPQRM/s/\nH7SOme10zpUC/wbkAIeBT5tZh4/yVyayNyaWf9fM0v4ROVX5+93nITOb5Zfszrlc4ocflgJngXvM\nrNZH+a8Dvkb88LdTwGfM7HSm5XfOLQO+TnyfRAdQDdwFZDPKr90UZv8tHrxu+/O8yEVEZGS8HloR\nEZERUpGLiPicilxExOdU5CIiPqciFxHxORW5iIjPqchFRHzu/wNvPRQSoEpwZQAAAABJRU5ErkJg\ngg==\n","text/plain":["<matplotlib.figure.Figure at 0x7f2062c93828>"]},"metadata":{"tags":[]}}]},{"metadata":{"id":"Cg4Ep7EEngyp","colab_type":"code","outputId":"477d0e25-2bce-4be7-b72e-29581ebf5cb7","executionInfo":{"status":"ok","timestamp":1546081157560,"user_tz":-480,"elapsed":5088,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["X_embedded = SelectFromModel(RFC_,threshold=0.00067).fit_transform(X,y)\n","X_embedded.shape"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(42000, 324)"]},"metadata":{"tags":[]},"execution_count":50}]},{"metadata":{"id":"dOuDf3SnnhzO","colab_type":"code","outputId":"ba507ae0-1fcd-459a-dfec-d2b7d622d357","executionInfo":{"status":"ok","timestamp":1546081177725,"user_tz":-480,"elapsed":17030,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["cross_val_score(RFC_,X_embedded,y,cv=5).mean()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0.939905083368037"]},"metadata":{"tags":[]},"execution_count":51}]},{"metadata":{"id":"-JCAfDmKnkz7","colab_type":"code","outputId":"6073576b-258c-4998-b697-dffac751e8f3","executionInfo":{"status":"ok","timestamp":1546082468878,"user_tz":-480,"elapsed":396513,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":340}},"cell_type":"code","source":["#======【TIME WARNING：10 mins】======#\n","score2 = []\n","for i in np.linspace(0,0.00134,20):\n","    X_embedded = SelectFromModel(RFC_,threshold=i).fit_transform(X,y)\n","    once = cross_val_score(RFC_,X_embedded,y,cv=5).mean()\n","    score2.append(once)\n","plt.figure(figsize=[20,5])\n","plt.plot(np.linspace(0,0.00134,20),score2)\n","plt.xticks(np.linspace(0,0.00134,20))\n","plt.show()"],"execution_count":0,"outputs":[{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAABIoAAAEvCAYAAAAq+CoPAAAABHNCSVQICAgIfAhkiAAAAAlw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Y\ny71XdeMP372IMQPTOFlcxqTZ23nsxQVMmrONowVFNVrvB1/uYMG6/WQkN+X+G3oQFqp2RLDSEUUi\nIiIiIiIi8l9aNIvilks7cfWQDGavzGHm8mymLs7i82XZDOmRzJiB6aS0rN6V0mat2MOni3aTFB/N\nQzdnEhWhVkQw07MjIiIiIiIiIpVqEhXO1UMyGDMwjQXr9zNtSRZfrtnHvDX76NM5kbGD0+nQOq7K\nxy/fnMvbn2+hWUw4j9zSm2ZNIuqweqkJNYpERERERERE5KzCw0IZ2TuV4b1as3JLHlOX7GblljxW\nbsmjc1pzxg5Kp1eHlv8175DNOsLLn2wgIiKUh8ZnktQ82sMEUl1qFImIiIiIiIhItYSE+OjfJYl+\nJhGbdZTPluxm/Y7DbMk+SmpiE64YmM6gbq3Yte8Yz7+/Dr8fvn9DTzKSm3ldulSTGkUiIiIiIiIi\ncl58Ph9d2sbTpW082bkFTF2ym6Ubc3n1001MnrcDgJNFpXz7mm50b9fC42rlfKhRJCIiIiIiIiI1\nlpYUy33XdOfG4e2ZsSybL9fspbiknPGXdOSi7slelyfnSY0iEREREREREblgCXHR3D6qM9cObUeR\nH1pEq+VQH4V4XYCIiIiIiIiINByx0eF0advivya2lvpDjSIREREREREREQHUKBIREREREREREZca\nRSIiIiIiIiIiAqhRJCIiIiIiIiIiLjWKREREREREREQEUKNIRERERERERERcahSJiIiIiIiIiAig\nRpGIiIiIiIiIiLjUKBIREREREREREUCNIhERERERERERcfn8fr/XNYiIiIiIiIiISBDQEUUiIiIi\nIiIiIgKoUSQiIiIiIiIiIi41ikREREREREREBFCjSEREREREREREXGoUiYiIiIiIiIgIoEaRiIiI\niIiIiIi4wrwuIFgZY54FBgN+4EFr7bIK940CfgeUAZ9Za39d1WOMMWnAm0AosA+4y1pbZIy5A3gI\nKAdetta+aowJB14H2rrrvsdau8MYkwn81V3vWmvt9+pZrv8HXO5uJgRIttZ2NsZEAX8Dultr+wdx\npnjg30CBtXbcGdtuBWwGbrDWzjHGhLjbu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N1OvUkOC+uuL+f5xpRE9dERGr1C7FUDXt3yWRC5brIz31emZu99UV\n88o1wDU1Ua+Pnf8TJ/eLc7u3P082iiRJkiRJkgS49EySJEmSJEmNjSJJkiRJkiQBNookSZIkSZLU\n2CiSJEmSJEkSYKNIkiRJkiRJjY0iSZIkSZIkATaKJEmSJEmS1NgokiRJkiRJEgDH88jm/Pyc/v4A\nAAAASUVORK5CYII=\n","text/plain":["<matplotlib.figure.Figure at 0x7f2061eff2b0>"]},"metadata":{"tags":[]}}]},{"metadata":{"id":"UkQX7x6Zn1x_","colab_type":"code","outputId":"93954ea0-476b-49bf-d23e-8d5e7760b348","executionInfo":{"status":"ok","timestamp":1546081242903,"user_tz":-480,"elapsed":5129,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["X_embedded = SelectFromModel(RFC_,threshold=0.000564).fit_transform(X,y)\n","X_embedded.shape\n"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(42000, 340)"]},"metadata":{"tags":[]},"execution_count":52}]},{"metadata":{"id":"Rjq8PHAWn3HP","colab_type":"code","outputId":"963db512-771a-40ba-b994-2b594e215ffc","executionInfo":{"status":"ok","timestamp":1546081265123,"user_tz":-480,"elapsed":17642,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["cross_val_score(RFC_,X_embedded,y,cv=5).mean()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0.9408335415056387"]},"metadata":{"tags":[]},"execution_count":53}]},{"metadata":{"id":"mRN4K_2En5ai","colab_type":"code","outputId":"e635833a-6937-4ef7-cf89-230d1015b0c1","executionInfo":{"status":"ok","timestamp":1546082860601,"user_tz":-480,"elapsed":135823,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["#=====【TIME WARNING：2 min】=====#\n","#我们可能已经找到了现有模型下的最佳结果，如果我们调整一下随机森林的参数呢？\n","cross_val_score(RFC(n_estimators=100,random_state=0),X_embedded,y,cv=5).mean()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0.960309871378534"]},"metadata":{"tags":[]},"execution_count":61}]},{"metadata":{"id":"U-vLLrDen_Vq","colab_type":"text"},"cell_type":"markdown","source":["## 4Wrapper包装法"]},{"metadata":{"id":"xRSTCiICoAnw","colab_type":"code","colab":{}},"cell_type":"code","source":["from sklearn.feature_selection import RFE\n","RFC_ = RFC(n_estimators =10,random_state=0)\n","selector = RFE(RFC_, n_features_to_select=340, step=50).fit(X, y)\n"],"execution_count":0,"outputs":[]},{"metadata":{"id":"UbMlkXKYoGC0","colab_type":"code","outputId":"b1e1366c-20e4-4b3c-cd50-a2e504f292dd","executionInfo":{"status":"ok","timestamp":1546081350802,"user_tz":-480,"elapsed":656,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["selector.support_.sum()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["340"]},"metadata":{"tags":[]},"execution_count":55}]},{"metadata":{"id":"Xo5K8-UPoILM","colab_type":"code","outputId":"d84a73d9-0b79-4058-f618-278112550721","executionInfo":{"status":"ok","timestamp":1546081354551,"user_tz":-480,"elapsed":704,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":829}},"cell_type":"code","source":["selector.ranking_"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array([10,  9,  8,  7,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,\n","        6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  7,  7,  6,  6,\n","        5,  6,  5,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  7,  6,  7,  7,\n","        7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  6,  6,  5,  4,\n","        4,  5,  3,  4,  4,  4,  5,  4,  5,  7,  6,  7,  7,  7,  8,  8,  8,\n","        8,  8,  8,  8,  8,  6,  7,  4,  3,  1,  2,  3,  3,  1,  1,  1,  1,\n","        1,  3,  3,  4,  5,  5,  5,  8,  8,  9,  9,  9,  9,  8,  9,  9,  4,\n","        4,  3,  2,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  3,  3,  4,\n","        5,  5,  9,  9, 10, 10, 10, 10,  7,  4,  4,  3,  1,  1,  1,  1,  1,\n","        1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  3,  3,  5,  8, 10, 10, 10,\n","       10,  9,  4,  4,  3,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,\n","        1,  1,  1,  1,  1,  3,  4, 10, 10, 10, 10,  9,  7,  4,  3,  2,  2,\n","        1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,\n","        4,  4, 10,  9, 10,  6,  6,  4,  2,  3,  1,  1,  1,  1,  1,  1,  1,\n","        1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  3,  5,  9, 10,  8,  7,\n","        4,  5,  3,  2,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,\n","        1,  1,  2,  1,  2,  4, 10, 10, 10,  9,  7,  5,  3,  3,  1,  1,  1,\n","        1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  3,  3,  5,\n","        5,  9,  9,  9,  7,  5,  5,  3,  2,  1,  1,  1,  1,  1,  1,  1,  1,\n","        1,  1,  1,  1,  1,  1,  1,  1,  2,  4,  5,  9,  9,  9,  9,  9,  5,\n","        4,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,\n","        1,  1,  1,  4,  5,  7, 10, 10,  9, 10,  9,  4,  1,  2,  1,  1,  1,\n","        1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  3,  5, 10,\n","        9, 10, 10,  9,  7,  4,  2,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,\n","        1,  1,  1,  1,  1,  1,  1,  2,  2,  4,  8,  9, 10, 10, 10,  5,  4,\n","        2,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,\n","        1,  2,  3,  5, 10, 10, 10, 10,  9,  5,  4,  1,  1,  1,  1,  1,  1,\n","        1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  3,  3,  4,  5,  9,\n","       10, 10, 10,  5,  3,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,\n","        1,  1,  1,  1,  1,  1,  3,  3,  4,  8,  8, 10, 10,  9,  5,  3,  3,\n","        1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,\n","        3,  3,  4, 10, 10, 10, 10,  8,  4,  3,  1,  1,  1,  1,  1,  1,  1,\n","        1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  4,  5,  8, 10, 10,\n","       10, 10,  5,  2,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,\n","        1,  1,  1,  1,  1,  2,  4,  7, 10, 10, 10, 10,  8,  5,  3,  2,  1,\n","        1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  3,  3,\n","        5,  5,  7,  9,  9,  9,  9,  5,  5,  2,  2,  1,  1,  1,  1,  1,  1,\n","        1,  1,  1,  1,  1,  1,  2,  2,  2,  3,  4,  5,  5,  8,  9,  9,  9,\n","        9,  7,  4,  4,  2,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,\n","        3,  3,  3,  5,  5,  9,  8,  9,  9,  9,  9,  9,  5,  4,  4,  2,  2,\n","        1,  1,  1,  1,  1,  2,  1,  1,  1,  1,  2,  2,  3,  4,  5,  5,  9,\n","        8,  8,  8,  8,  8,  8,  7,  8,  6,  4,  2,  2,  1,  1,  2,  2,  1,\n","        2,  2,  3,  2,  2,  4,  4,  5,  5,  8,  8,  8,  7,  7,  7,  7,  7,\n","        7,  7,  5,  5,  4,  5,  4,  3,  3,  3,  4,  3,  3,  4,  3,  4,  5,\n","        5,  6,  7,  7,  7,  6,  7,  8,  8,  8,  9,  9,  9,  9,  6,  8,  8,\n","        8,  7,  8,  8,  8,  7,  8,  8,  8,  8,  8,  7,  8,  8,  8,  8,  9,\n","       10,  7])"]},"metadata":{"tags":[]},"execution_count":56}]},{"metadata":{"id":"qkcWL9rcoJJ_","colab_type":"code","outputId":"cab8de87-0c25-4b2f-cc48-db0c4002a4ad","executionInfo":{"status":"ok","timestamp":1546081375949,"user_tz":-480,"elapsed":16998,"user":{"displayName":"Sen Yang","photoUrl":"","userId":"00832503676208839570"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"cell_type":"code","source":["X_wrapper = selector.transform(X)\n","cross_val_score(RFC_,X_wrapper,y,cv=5).mean()"],"execution_count":0,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0.9389522459432109"]},"metadata":{"tags":[]},"execution_count":57}]},{"metadata":{"id":"5WRvTI-poMbS","colab_type":"code","colab":{}},"cell_type":"code","source":["#======【TIME WARNING: 15 mins】======#\n","score = []\n","for i in range(1,751,50):\n","    X_wrapper = RFE(RFC_,n_features_to_select=i, step=50).fit_transform(X,y)\n","    once = cross_val_score(RFC_,X_wrapper,y,cv=5).mean()\n","    score.append(once)\n","plt.figure(figsize=[20,5])\n","plt.plot(range(1,751,50),score)\n","plt.xticks(range(1,751,50))\n","plt.show()"],"execution_count":0,"outputs":[]}]}